diff options
author | Jeremy Katz <katzj@redhat.com> | 2003-01-23 22:55:14 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2003-01-23 22:55:14 +0000 |
commit | 977f6207719f8c0470eca1404624784d723bdc4a (patch) | |
tree | 333b4b70e336536f13ecc5602724794560bb492d /textw | |
parent | 87a10efed6a06b14ecf4bca18afac09ad7800d45 (diff) | |
download | anaconda-977f6207719f8c0470eca1404624784d723bdc4a.tar.gz anaconda-977f6207719f8c0470eca1404624784d723bdc4a.tar.xz anaconda-977f6207719f8c0470eca1404624784d723bdc4a.zip |
only allow ascii passwords. anything else is nonsensical and impossible to
handle sanely due to lack of a defined encoding for the passwd file (#81534)
Diffstat (limited to 'textw')
-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 ced88eb63..466f336f6 100644 --- a/textw/userauth_text.py +++ b/textw/userauth_text.py @@ -17,8 +17,15 @@ from rhpl.translate import _ import iutil from flags import flags +def has_bad_chars(pw): + allowed = string.digits + string.ascii_letters + string.punctuation + for letter in pw: + if letter not in allowed: + return 1 + return 0 + class RootPasswordWindow: - def __call__ (self, screen, rootPw): + def __call__ (self, screen, intf, rootPw): toplevel = GridFormHelp (screen, _("Root Password"), "rootpw", 1, 3) toplevel.add (TextboxReflowed(37, _("Pick a root password. You must " @@ -60,6 +67,11 @@ class RootPasswordWindow: _("The passwords you entered were different. Please " "try again."), buttons = [ TEXT_OK_BUTTON ], width = 50) + elif has_bad_chars(entry1.value()): + ButtonChoiceWindow(screen, _("Error with Password"), + _("Requested password contains non-ascii characters " + "which are not allowed for use in password."), + buttons = [ TEXT_OK_BUTTON ], width = 50) else: break |