Skip to content

Commit

Permalink
installer: handle special characters in passwords better.
Browse files Browse the repository at this point in the history
  • Loading branch information
mtwebster authored and clefebvre committed Feb 15, 2022
1 parent 86b47d7 commit 3a6703d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions usr/lib/live-installer/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import sys
import parted
import partitioning
import shlex

gettext.install("live-installer", "/usr/share/locale")

Expand Down Expand Up @@ -260,9 +261,9 @@ def create_partitions(self):
# Encrypt root partition
if self.setup.luks:
print(" --> Encrypting root partition %s" % self.auto_root_partition)
os.system("printf \"%s\" | cryptsetup luksFormat -c aes-xts-plain64 -h sha256 -s 512 %s" % (self.setup.passphrase1, self.auto_root_partition))
os.system("echo -n %s | cryptsetup luksFormat -c aes-xts-plain64 -h sha256 -s 512 %s" % (shlex.quote(self.setup.passphrase1), self.auto_root_partition))
print(" --> Opening root partition %s" % self.auto_root_partition)
os.system("printf \"%s\" | cryptsetup luksOpen %s lvmlmde" % (self.setup.passphrase1, self.auto_root_partition))
os.system("echo -n %s | cryptsetup luksOpen %s lvmlmde" % (shlex.quote(self.setup.passphrase1), self.auto_root_partition))
self.auto_root_partition = "/dev/mapper/lvmlmde"

# Setup LVM
Expand Down

0 comments on commit 3a6703d

Please sign in to comment.