FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 07-15-2010, 07:59 AM
Martin Gracik
 
Default Add weak password checking

Show a warning in the text entry, when the entered password
for new user is weak.
---
modules/create_user.py | 29 +++++++++++++++++++++++++++++
1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/modules/create_user.py b/modules/create_user.py
index 659fa92..f9e10ac 100644
--- a/modules/create_user.py
+++ b/modules/create_user.py
@@ -21,6 +21,7 @@ import gtk
import libuser
import os, string, sys, time
import os.path
+import cracklib

from firstboot.config import *
from firstboot.constants import *
@@ -222,6 +223,13 @@ class moduleClass(Module):
self.fullnameEntry = gtk.Entry()
self.passwordEntry = gtk.Entry()
self.passwordEntry.set_visibility(False)
+ self.passwordEntry.set_property("primary-icon-stock",
+ gtk.STOCK_DIALOG_WARNING)
+ self.passwordEntry.set_property("primary-icon-tooltip-text",
+ _("Password empty"))
+ self.passwordEntry.set_property("primary-icon-activatable", False)
+ self.passwordEntry.connect("changed", self.passwordEntry_changed)
+
self.confirmEntry = gtk.Entry()
self.confirmEntry.set_visibility(False)

@@ -328,3 +336,24 @@ class moduleClass(Module):
rc = dlg.run()
dlg.destroy()
return None
+
+ def passwordEntry_changed(self, entry):
+ pw = entry.get_text()
+ if not pw:
+ entry.set_property("primary-icon-stock", gtk.STOCK_DIALOG_WARNING)
+ entry.set_property("primary-icon-tooltip-text",
+ _("Password empty"))
+ return
+
+ try:
+ cracklib.FascistCheck(pw)
+ except ValueError as e:
+ msg = gettext.ldgettext("cracklib", e)
+
+ entry.set_property("primary-icon-stock", gtk.STOCK_DIALOG_WARNING)
+ entry.set_property("primary-icon-tooltip-text",
+ _("Weak password: %s") % msg)
+ else:
+ entry.set_property("primary-icon-stock", gtk.STOCK_APPLY)
+ entry.set_property("primary-icon-tooltip-text",
+ _("Password OK"))
--
1.7.1.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 07-16-2010, 11:40 PM
"Brian C. Lane"
 
Default Add weak password checking

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 07/15/2010 12:59 AM, Martin Gracik wrote:
> Show a warning in the text entry, when the entered password
> for new user is weak.


Looks good to me, I like this style of doing things better than the
dialog that has to be dismissed.

- --
Brian C. Lane <bcl@redhat.com>
Red Hat / Port Orchard, WA
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQEVAwUBTEDt6xF+jBaO/jp/AQLSvgf/RpISnFmsDJDI8MQQkPd9zpEEY6aBiEdx
A7OFHu3kHx6xG2b6tQMftMV3JU+GnJ2MPryZEXD3XM0NvNW/o3bjvbsIvWIH2DEk
Q0+dgnMOj7brfk38l1WdT/w0dg8kLDBvrJ14JF8/xE7BBldwlTDivBGwoDrPzpLi
mIzSZbQ0sJlO5g2A41gYBws73MP+HLbu+MLpS39FM1TlXw2Qs3 XWDVRbi3g20WsH
0S8sCDPXPrFwsH/2JmxJomThHhZdhUfI6yZ2TU920T7EDoQVvut0fBqhomRhf7af
Yh3YFMrdk8QWEiNN7SkqKHKzjKn0T6KhidNmZbSg0yEgHcPcdi ePXA==
=B7Zd
-----END PGP SIGNATURE-----

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 07-19-2010, 02:50 PM
Chris Lumens
 
Default Add weak password checking

> Looks good to me, I like this style of doing things better than the
> dialog that has to be dismissed.

Yeah, but I think the dialog is still there to handle the case where the
user hits the "Next" button, right? It's been a while since I looked at
firstboot so maybe I'm making things up. Anyway it'd be nice to kill
that dialog.

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 07-20-2010, 08:39 AM
Martin Gracik
 
Default Add weak password checking

The dialog is still there in case you don't create the user at all,
or the 2 password fields don't match, it is there to show errors,
not warnings. It didn't check the password weakness before.
I don't know about a possible solution to kill the dialog in error cases,
if someone has any ideas, tell me please

--

Martin Gracik

----- "Chris Lumens" <clumens@redhat.com> wrote:

> > Looks good to me, I like this style of doing things better than the
> > dialog that has to be dismissed.
>
> Yeah, but I think the dialog is still there to handle the case where
> the
> user hits the "Next" button, right? It's been a while since I looked
> at
> firstboot so maybe I'm making things up. Anyway it'd be nice to kill
> that dialog.
>
> - Chris
>
> _______________________________________________
> Anaconda-devel-list mailing list
> Anaconda-devel-list@redhat.com
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 06:56 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org