diff options
author | Chris Lumens <clumens@redhat.com> | 2008-12-15 10:56:44 -0500 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2008-12-15 10:56:44 -0500 |
commit | e0cbcf83ffcfd3daf9f668b93caf48491a1b5091 (patch) | |
tree | 3a4040f9f486e97de6dee27d2eb99e9914fa3e6b | |
parent | e1c31e881c8dd6e33de43758b143eccf8300fb1c (diff) | |
download | anaconda-e0cbcf83ffcfd3daf9f668b93caf48491a1b5091.tar.gz anaconda-e0cbcf83ffcfd3daf9f668b93caf48491a1b5091.tar.xz anaconda-e0cbcf83ffcfd3daf9f668b93caf48491a1b5091.zip |
cracklib now raises exceptions on bad passwords (rzhou, #476312).
-rw-r--r-- | iw/account_gui.py | 6 | ||||
-rw-r--r-- | textw/userauth_text.py | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/iw/account_gui.py b/iw/account_gui.py index 45f396be2..2e54714e3 100644 --- a/iw/account_gui.py +++ b/iw/account_gui.py @@ -125,8 +125,10 @@ class AccountWindow (InstallWindow): custom_icon="error") self.passwordError() - msg = gettext.ldgettext("cracklib", cracklib.FascistCheck(pw)) - if msg is not None: + try: + cracklib.FascistCheck(pw) + except ValueError, e: + msg = gettext.ldgettext("cracklib", e) ret = self.intf.messageWindow(_("Weak Password"), _("Weak password provided: %s" "\n\n" diff --git a/textw/userauth_text.py b/textw/userauth_text.py index 152a1c620..84966e954 100644 --- a/textw/userauth_text.py +++ b/textw/userauth_text.py @@ -76,8 +76,10 @@ class RootPasswordWindow: "which are not allowed."), buttons = [ TEXT_OK_BUTTON ], width = 50) else: - msg = gettext.ldgettext("cracklib", cracklib.FascistCheck(entry1.value())) - if msg is not None: + try: + cracklib.FascistCheck(entry1.value()) + except ValueError, e: + msg = gettext.ldgettext("cracklib", e) ret = anaconda.intf.messageWindow(_("Weak Password"), _("Weak password provided: %s\n\n" "Would you like to continue with this password?" |