summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Lehman <dlehman@redhat.com>2008-09-15 12:59:29 -0500
committerDavid Lehman <dlehman@redhat.com>2008-09-15 13:27:28 -0500
commitc19c23eaf1654adf88e7575b062538da6f353584 (patch)
tree13d1aa430cc6a1d18309ece5d8a65d187bad8820
parent4f14856e6a163af9b03842ebe2bd1e01c2d73b49 (diff)
downloadanaconda-c19c23eaf1654adf88e7575b062538da6f353584.tar.gz
anaconda-c19c23eaf1654adf88e7575b062538da6f353584.tar.xz
anaconda-c19c23eaf1654adf88e7575b062538da6f353584.zip
New device passphrase is now always global w/ option to retrofit.
Retrofit in this context means to add the new passphrase to all preexisting LUKS devices that we have keys to. This is an effort to simplify management of systems containing encrypted devices.
-rwxr-xr-xgui.py31
-rw-r--r--text.py37
-rw-r--r--ui/lukspassphrase.glade2
3 files changed, 26 insertions, 44 deletions
diff --git a/gui.py b/gui.py
index 1e1fe4e6e..dfd0a345c 100755
--- a/gui.py
+++ b/gui.py
@@ -623,8 +623,7 @@ class InstallKeyWindow:
self.win.destroy()
class luksPassphraseWindow:
- def __init__(self, passphrase=None, device = "", isglobal = False,
- parent = None):
+ def __init__(self, passphrase=None, preexist = False, parent = None):
luksxml = gtk.glade.XML(findGladeFile("lukspassphrase.glade"),
domain="anaconda",
root="luksPassphraseDialog")
@@ -635,15 +634,12 @@ class luksPassphraseWindow:
self.win = luksxml.get_widget("luksPassphraseDialog")
self.okButton = luksxml.get_widget("okbutton1")
self.globalcheckbutton = luksxml.get_widget("globalcheckbutton")
- self.isglobal = isglobal
- if isglobal and not passphrase:
- # we must be prompting for autopart passphrase
+
+ self.isglobal = preexist
+ if not preexist:
self.globalcheckbutton.hide()
- elif not passphrase:
- # gently encourage the use of a global passphrase
- self.globalcheckbutton.set_active(True)
else:
- self.globalcheckbutton.set_active(isglobal)
+ self.globalcheckbutton.set_active(True)
self.minimumLength = 8 # arbitrary; should probably be much larger
if passphrase:
@@ -653,13 +649,9 @@ class luksPassphraseWindow:
else:
self.initialPassphrase = ""
- if device:
- deviceStr = " (%s)" % (device,)
- else:
- deviceStr = ""
- txt = _("Choose a passphrase for this encrypted device%s. "
+ txt = _("Choose a passphrase for your encrypted devices. "
"You will be prompted for the passphrase during system "
- "boot.") % (deviceStr,)
+ "boot.")
luksxml.get_widget("mainLabel").set_text(txt)
if parent:
@@ -692,9 +684,8 @@ class luksPassphraseWindow:
self.confirmEntry.set_text("")
continue
- if not self.isglobal and not self.initialPassphrase:
+ if self.isglobal:
self.isglobal = self.globalcheckbutton.get_active()
-
else:
self.passphraseEntry.set_text(self.initialPassphrase)
self.confirmEntry.set_text(self.initialPassphrase)
@@ -1254,14 +1245,14 @@ class InstallInterface:
d.destroy()
return ret
- def getLuksPassphrase(self, passphrase = "", device = "", isglobal = False):
+ def getLuksPassphrase(self, passphrase = "", preexist = False):
if self.icw:
parent = self.icw.window
else:
parent = None
- d = luksPassphraseWindow(passphrase, parent = parent, device = device,
- isglobal = isglobal)
+ d = luksPassphraseWindow(passphrase, parent = parent,
+ preexist = preexist)
rc = d.run()
passphrase = d.getPassphrase()
isglobal = d.getGlobal()
diff --git a/text.py b/text.py
index c35398ac5..2349f72e5 100644
--- a/text.py
+++ b/text.py
@@ -311,18 +311,13 @@ class MainExceptionWindow:
self.screen.refresh()
class LuksPassphraseWindow:
- def __init__(self, screen, passphrase = "", device = "", isglobal = False):
+ def __init__(self, screen, passphrase = "", preexist = False):
self.screen = screen
self.passphrase = passphrase
self.minLength = 8
- self.isglobal = isglobal
- if device:
- deviceStr = " (%s)" % (device,)
- else:
- deviceStr = ""
- self.txt = _("Choose a passphrase for this encrypted device%s. "
- "You will be prompted for the passphrase during system "
- "boot.") % (deviceStr,)
+ self.preexist = preexist
+ self.txt = _("Choose a passphrase for your encrypted devices. You "
+ "will be prompted for the passphrase during system boot.")
self.rc = None
def run(self):
@@ -338,13 +333,8 @@ class LuksPassphraseWindow:
confirmentry = Entry(60, password = 1)
toplevel.add(confirmentry, 0, 2, (0,0,0,1))
- if not (self.isglobal and not self.passphrase):
- if not self.passphrase:
- isglobal = True
- else:
- isglobal = self.isglobal
- # if we don't hit this we're prompting for autopart passphrase
- globalcheckbox = Checkbox(_("Use this passphrase for all new encrypted devices"), isOn = isglobal)
+ if self.preexist:
+ globalcheckbox = Checkbox(_("Also add this passphrase to all existing encrypted devices"), isOn = True)
toplevel.add(globalcheckbox, 0, 3)
buttons = ButtonBar(self.screen, [TEXT_OK_BUTTON, TEXT_CANCEL_BUTTON])
@@ -386,10 +376,11 @@ class LuksPassphraseWindow:
passphraseentry.set(self.passphrase)
confirmentry.set(self.passphrase)
- if not self.isglobal and not self.passphrase:
- self.isglobal = globalcheckbox.selected()
+ retrofit = False
+ if self.preexist:
+ retrofit = globalcheckbox.selected()
self.rc = passphrase
- return (self.rc, self.isglobal)
+ return (self.rc, retrofit)
def pop(self):
self.screen.popWindow()
@@ -492,12 +483,12 @@ class InstallInterface:
r.strip()
return r
- def getLuksPassphrase(self, passphrase = "", device = "", isglobal = False):
+ def getLuksPassphrase(self, passphrase = "", preexist = False):
w = LuksPassphraseWindow(self.screen, passphrase = passphrase,
- device = device, isglobal = isglobal)
- (passphrase, isglobal) = w.run()
+ preexist = preexist)
+ rc = w.run()
w.pop()
- return (passphrase, isglobal)
+ return rc
def passphraseEntryWindow(self, device):
w = PassphraseEntryWindow(self.screen, device)
diff --git a/ui/lukspassphrase.glade b/ui/lukspassphrase.glade
index 4132a93db..8177b53cf 100644
--- a/ui/lukspassphrase.glade
+++ b/ui/lukspassphrase.glade
@@ -244,7 +244,7 @@
<property name="border_width">5</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Use this passphrase for all new encrypted devices</property>
+ <property name="label" translatable="yes">Also add this passphrase to all existing encrypted devices to streamline the boot process</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>