diff options
author | HARA Hiroshi <hhara@miraclelinux.com> | 2007-12-18 11:19:30 +0900 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2007-12-17 21:44:46 -0500 |
commit | 2a98aa4e77cbe2aec4a5de53b3d8f625fccdd919 (patch) | |
tree | 0c22c441c2843b31dda9fb262727e4c5a55ea329 /textw/userauth_text.py | |
parent | 4dba03fb17130344fc02de5d73310030717978a5 (diff) | |
download | anaconda-2a98aa4e77cbe2aec4a5de53b3d8f625fccdd919.tar.gz anaconda-2a98aa4e77cbe2aec4a5de53b3d8f625fccdd919.tar.xz anaconda-2a98aa4e77cbe2aec4a5de53b3d8f625fccdd919.zip |
Validation of root password with cracklib
Current anaconda validates only length of root password.
but passwd command validates more things for password
like the following...
-------------------------------------------
Changing password for user root.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
-------------------------------------------
so I added the validation of root password to
anaconda using cracklib same as passwd.
Diffstat (limited to 'textw/userauth_text.py')
-rw-r--r-- | textw/userauth_text.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/textw/userauth_text.py b/textw/userauth_text.py index 6556b0730..a4218f928 100644 --- a/textw/userauth_text.py +++ b/textw/userauth_text.py @@ -20,6 +20,7 @@ from snack import * from constants_text import * from rhpl.translate import _ +import cracklib def has_bad_chars(pw): allowed = string.digits + string.ascii_letters + string.punctuation + " " @@ -77,7 +78,18 @@ class RootPasswordWindow: "which are not allowed."), buttons = [ TEXT_OK_BUTTON ], width = 50) else: - break + msg = cracklib.FascistCheck(entry1.value()) + if msg is not None: + ret = anaconda.intf.messageWindow(_("Weak Password"), + _("Weak password provided: %s" + "\n\n" + "Would you like to continue with this " + "password?" % (msg, )), + type = "yesno") + if ret == 1: + break + else: + break entry1.set ("") entry2.set ("") |