svn commit: trunk/busybox/loginutils

vda at busybox.net vda at busybox.net
Tue Dec 19 00:33:54 UTC 2006


Author: vda
Date: 2006-12-18 16:33:53 -0800 (Mon, 18 Dec 2006)
New Revision: 17002

Log:
passwd: add option to check passwords for weakness


Modified:
   trunk/busybox/loginutils/Config.in
   trunk/busybox/loginutils/passwd.c


Changeset:
Modified: trunk/busybox/loginutils/Config.in
===================================================================
--- trunk/busybox/loginutils/Config.in	2006-12-19 00:29:22 UTC (rev 17001)
+++ trunk/busybox/loginutils/Config.in	2006-12-19 00:33:53 UTC (rev 17002)
@@ -142,6 +142,13 @@
 	  Note that Busybox binary must be setuid root for this applet to
 	  work properly.
 
+config FEATURE_PASSWD_WEAK_CHECK
+	bool "Check new passwords for weakness"
+	default y
+	depends on PASSWD
+	help
+	  With this option passwd will refuse new passwords which are "weak".
+
 config SU
 	bool "su"
 	default n

Modified: trunk/busybox/loginutils/passwd.c
===================================================================
--- trunk/busybox/loginutils/passwd.c	2006-12-19 00:29:22 UTC (rev 17001)
+++ trunk/busybox/loginutils/passwd.c	2006-12-19 00:33:53 UTC (rev 17002)
@@ -77,7 +77,8 @@
 	if (!newp)
 		goto err_ret;
 	newp = xstrdup(newp); /* we are going to bb_askpass() again, so save it */
-	if (obscure(orig, newp, pw) && myuid)
+	if (ENABLE_FEATURE_PASSWD_WEAK_CHECK
+	 && obscure(orig, newp, pw) && myuid)
 		goto err_ret; /* non-root is not allowed to have weak passwd */
 
 	cp = bb_askpass(0, "Retype password:");




More information about the busybox-cvs mailing list