summaryrefslogtreecommitdiffstats
path: root/textw/userauth_text.py
diff options
context:
space:
mode:
authorHARA Hiroshi <hhara@miraclelinux.com>2007-12-18 11:19:30 +0900
committerJeremy Katz <katzj@redhat.com>2007-12-17 21:44:46 -0500
commit2a98aa4e77cbe2aec4a5de53b3d8f625fccdd919 (patch)
tree0c22c441c2843b31dda9fb262727e4c5a55ea329 /textw/userauth_text.py
parent4dba03fb17130344fc02de5d73310030717978a5 (diff)
downloadanaconda-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.py14
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 ("")