diff options
author | David Lehman <dlehman@redhat.com> | 2008-08-13 20:51:41 -0500 |
---|---|---|
committer | David Lehman <dlehman@redhat.com> | 2008-08-13 20:57:11 -0500 |
commit | 430d1b25575c66790fa7b5b1e54833c36441d2a3 (patch) | |
tree | c8eae6ca5c1db58feba7c2aa2830d94a7cde6773 /partitions.py | |
parent | ccc43e98a5c8025346a3660c2981a6388b7c3cb9 (diff) | |
download | anaconda-430d1b25575c66790fa7b5b1e54833c36441d2a3.tar.gz anaconda-430d1b25575c66790fa7b5b1e54833c36441d2a3.tar.xz anaconda-430d1b25575c66790fa7b5b1e54833c36441d2a3.zip |
In kickstart, prompt for new LUKS dev passphrase if not specified. (#446930)
Diffstat (limited to 'partitions.py')
-rw-r--r-- | partitions.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/partitions.py b/partitions.py index 761d47333..34a00c5de 100644 --- a/partitions.py +++ b/partitions.py @@ -100,6 +100,39 @@ def partitioningComplete(anaconda): and not request.mountpoint)): continue + if anaconda.isKickstart and \ + request.encryption and not request.encryption.passphrase: + partitions = anaconda.id.partitions + if partitions.autoEncrypt and partitions.autoEncryptPass: + request.encryption.setPassphrase(partitions.autoEncryptPass) + else: + if partitions.autoEncrypt: + dev = "" + else: + dev = request.getDevice(partitions).getDevice(asBoot=1) + + while True: + passphrase = anaconda.intf.getLuksPassphrase(device=dev) + if passphrase: + request.encryption.setPassphrase(passphrase) + if partitions.autoEncrypt: + partitions.autoEncryptPass = passphrase + break + else: + # perhaps a warning that we're not going to encrypt? + rc = anaconda.intf.messageWindow(_("Encrypt device?"), + _("You specified that device %s should be " + "encrypted, but you have not supplied a " + "passphrase. If you do not go back and " + "provide a passphrase, the device will " + "not be encrypted.") % (dev,), + type="custom", + custom_buttons=[_("Back"), _("Continue")], + default=0) + if rc == 1: + request.encryption = None + break + entry = request.toEntry(anaconda.id.partitions) if entry: anaconda.id.fsset.add (entry) |