summaryrefslogtreecommitdiffstats
path: root/gui.py
diff options
context:
space:
mode:
authorDavid Lehman <dlehman@redhat.com>2008-08-18 15:43:23 -0500
committerDavid Lehman <dlehman@redhat.com>2008-08-19 15:44:49 -0500
commit975d1148aaf2e9a24a662eae9ca14f0e7b1626ca (patch)
tree0343117f0922d36db1ae5213b0c2f338a3f5bf1e /gui.py
parent8ee3a64b9837fa428d01007cb0c2b8003d30fddb (diff)
downloadanaconda-975d1148aaf2e9a24a662eae9ca14f0e7b1626ca.tar.gz
anaconda-975d1148aaf2e9a24a662eae9ca14f0e7b1626ca.tar.xz
anaconda-975d1148aaf2e9a24a662eae9ca14f0e7b1626ca.zip
Support establishing a global passphrase when creating encrypted devices.
Diffstat (limited to 'gui.py')
-rwxr-xr-xgui.py29
1 files changed, 25 insertions, 4 deletions
diff --git a/gui.py b/gui.py
index b7c3596d6..c0d3031f5 100755
--- a/gui.py
+++ b/gui.py
@@ -623,7 +623,8 @@ class InstallKeyWindow:
self.win.destroy()
class luksPassphraseWindow:
- def __init__(self, passphrase=None, device = "", parent = None):
+ def __init__(self, passphrase=None, device = "", isglobal = False,
+ parent = None):
luksxml = gtk.glade.XML(findGladeFile("lukspassphrase.glade"),
domain="anaconda",
root="luksPassphraseDialog")
@@ -633,6 +634,17 @@ class luksPassphraseWindow:
self.confirmEntry.set_visibility(False)
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.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.minimumLength = 8 # arbitrary; should probably be much larger
if passphrase:
self.initialPassphrase = passphrase
@@ -679,6 +691,10 @@ class luksPassphraseWindow:
self.passphraseEntry.set_text("")
self.confirmEntry.set_text("")
continue
+
+ if not self.isglobal and not self.initialPassphrase:
+ self.isglobal = self.globalcheckbutton.get_active()
+
else:
self.passphraseEntry.set_text(self.initialPassphrase)
self.confirmEntry.set_text(self.initialPassphrase)
@@ -688,6 +704,9 @@ class luksPassphraseWindow:
def getPassphrase(self):
return self.passphraseEntry.get_text()
+ def getGlobal(self):
+ return self.isglobal
+
def getrc(self):
return self.rc
@@ -1228,17 +1247,19 @@ class InstallInterface:
d.destroy()
return ret
- def getLuksPassphrase(self, passphrase = "", device = ""):
+ def getLuksPassphrase(self, passphrase = "", device = "", isglobal = False):
if self.icw:
parent = self.icw.window
else:
parent = None
- d = luksPassphraseWindow(passphrase, device = device, parent = parent)
+ d = luksPassphraseWindow(passphrase, parent = parent, device = device,
+ isglobal = isglobal)
rc = d.run()
passphrase = d.getPassphrase()
+ isglobal = d.getGlobal()
d.destroy()
- return passphrase
+ return (passphrase, isglobal)
def passphraseEntryWindow(self, device):
if self.icw: