summaryrefslogtreecommitdiffstats
path: root/iw
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 /iw
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 'iw')
-rw-r--r--iw/account_gui.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/iw/account_gui.py b/iw/account_gui.py
index 22e4d8a5b..c4eb334f2 100644
--- a/iw/account_gui.py
+++ b/iw/account_gui.py
@@ -24,6 +24,7 @@ import gui
from iw_gui import *
from rhpl.translate import _, N_
from flags import flags
+import cracklib
def handleCapsLockRelease(window, event, label):
if event.keyval == gtk.keysyms.Caps_Lock and event.state & gtk.gdk.LOCK_MASK:
@@ -70,6 +71,17 @@ class AccountWindow (InstallWindow):
"six characters long."),
custom_icon="error")
passwordError()
+
+ msg = cracklib.FascistCheck(pw)
+ if msg is not None:
+ ret = self.intf.messageWindow(_("Weak Password"),
+ _("Weak password provided: %s"
+ "\n\n"
+ "Would you like to continue with this "
+ "password?" % (msg, )),
+ type = "yesno")
+ if ret == 0:
+ passwordError()
allowed = string.digits + string.ascii_letters + string.punctuation + " "
for letter in pw: