Antergos / Cnchi

A modern, flexible online system installer for Antergos Linux
GNU General Public License v3.0
291 stars 101 forks source link

LUKS volume name needs proper escaping #1092

Open tengwar opened 6 years ago

tengwar commented 6 years ago

Problem:

When I try to use "Arch LUKS volume" as the LUKS volume label, I get this error (note the spaces are not escaped):

mkfs.ext4: invalid blocks 'LUKS' on device '/dev/mapper/Arch' 2018-09-16 19:01:25 [ERROR] fs_module.py(262) create_fs(): Error running ['mkfs.ext4', '-F', '-q', '-L', 'Arch', '-m', '1', '-O', 'dir_index', '/dev/mapper/Arch', 'LUKS', 'volume']: b''

And when I try to use "arch-luks-volume" I get this error:

The file /dev/mapper/arch-luks-volume does not exist and no size was specified. 2018-09-16 19:26:10 [ERROR] fs_module.py(262) create_fs(): Error running ['mkfs.ext4', '-F', '-q', '-L', 'Arch', '-m', '1', '-O', 'dir_index', '/dev/mapper/arch-luks-volume']: b''

Which is caused by the fact that /dev/mapper contains another file:

[antergos@ant-18.8 ~]$ sudo ls /dev/mapper/ 'Arch\x20LUKS\x20volume' control

As you can see, this is a leftover from the previous installer run. The installer should deal with it or at least tell the user to restart the computer. And when encountering errors it should not just close its window as if it was done installing:

Gdk-Message: 19:26:10.190: cnchi.py: Fatal IO error 0 (Sukces) on X server :0. [xcb] Unknown sequence number while processing queue [xcb] Most likely this is a multi-threaded client and XInitThreads has not been called [xcb] Aborting, sorry about that. python: xcb_io.c:259: poll_for_event: Warunek zapewnienia `!xcb_xlib_threads_sequence_lost' nie został spełniony. /usr/share/cnchi/bin/cnchi: linia 3: 3635 Przerwane (zrzut pamięci) /usr/bin/env python /usr/share/cnchi/src/cnchi.py -d -v ${@}

Steps To Reproduce:

  1. Run the installer and proceed up to the partitioning step.
  2. Select manual partitioning.
  3. Create an encrypted partition with LUKS volume label that contains spaces.
  4. Select / for its mount point and continue with the installation.
  5. The cnchi window closes for the reasons mentioned above.

Log Files

https://paste2.org/fgHGnwZf

Additional Notes:

karasu commented 6 years ago

Not tested yet. Reopening.

karasu commented 6 years ago

There was a bug in 0.16.3 that prevented creating a new partition and establish LUKS at the same time (it did work if we edited the partition later). Cnchi 0.16.8 fixes this. I still need to test it, though.