svn commit: trunk/busybox/libbb

rpjday at busybox.net rpjday at busybox.net
Sun Jul 2 18:35:41 UTC 2006


Author: rpjday
Date: 2006-07-02 11:35:39 -0700 (Sun, 02 Jul 2006)
New Revision: 15580

Log:
Allow a user-configurable minimum password length.


Modified:
   trunk/busybox/libbb/Config.in
   trunk/busybox/libbb/obscure.c


Changeset:
Modified: trunk/busybox/libbb/Config.in
===================================================================
--- trunk/busybox/libbb/Config.in	2006-07-02 18:27:23 UTC (rev 15579)
+++ trunk/busybox/libbb/Config.in	2006-07-02 18:35:39 UTC (rev 15580)
@@ -5,6 +5,13 @@
 
 menu "Busybox Library Tuning"
 
+config CONFIG_PASSWORD_MINLEN
+	int "Minimum password length"
+	default 6
+	range 5 32
+	help
+	  Minimum allowable password length.
+
 config CONFIG_MD5_SIZE_VS_SPEED
 	int " MD5: Trade Bytes for Speed"
 	default 2

Modified: trunk/busybox/libbb/obscure.c
===================================================================
--- trunk/busybox/libbb/obscure.c	2006-07-02 18:27:23 UTC (rev 15579)
+++ trunk/busybox/libbb/obscure.c	2006-07-02 18:35:39 UTC (rev 15580)
@@ -46,11 +46,6 @@
 
 #include "libbb.h"
 
-
-/* passwords should consist of 6 (to 8 characters) */
-#define MINLEN 6
-
-
 static int string_checker_helper(const char *p1, const char *p2) __attribute__ ((__pure__));
 
 static int string_checker_helper(const char *p1, const char *p2)
@@ -101,12 +96,12 @@
 	int length;
 	int mixed = 0;
 	/* Add 1 for each type of characters to the minlen of password */
-	int size = MINLEN + 8;
+	int size = CONFIG_PASSWORD_MINLEN + 8;
 	const char *p;
 	char hostname[255];
 
 	/* size */
-	if (!new_p || (length = strlen(new_p)) < MINLEN)
+	if (!new_p || (length = strlen(new_p)) < CONFIG_PASSWORD_MINLEN)
 		return("too short");
 
 	/* no username as-is, as sub-string, reversed, capitalized, doubled */




More information about the busybox-cvs mailing list