diff options
author | "Robert P. J. Day" <rpjday@mindspring.com> | 2006-07-02 18:35:39 +0000 |
---|---|---|
committer | "Robert P. J. Day" <rpjday@mindspring.com> | 2006-07-02 18:35:39 +0000 |
commit | 087b9d640ed66f37249c09885fa86b27a78554c7 (patch) | |
tree | 2186495a0096f2adeb2691f749efe83b9b6d881e /libbb/obscure.c | |
parent | e02706fe45c46939319be7a9f4b2018393fb173b (diff) | |
download | busybox-w32-087b9d640ed66f37249c09885fa86b27a78554c7.tar.gz busybox-w32-087b9d640ed66f37249c09885fa86b27a78554c7.tar.bz2 busybox-w32-087b9d640ed66f37249c09885fa86b27a78554c7.zip |
Allow a user-configurable minimum password length.
Diffstat (limited to 'libbb/obscure.c')
-rw-r--r-- | libbb/obscure.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/libbb/obscure.c b/libbb/obscure.c index d6a87b5de..4a8fbf72c 100644 --- a/libbb/obscure.c +++ b/libbb/obscure.c | |||
@@ -46,11 +46,6 @@ | |||
46 | 46 | ||
47 | #include "libbb.h" | 47 | #include "libbb.h" |
48 | 48 | ||
49 | |||
50 | /* passwords should consist of 6 (to 8 characters) */ | ||
51 | #define MINLEN 6 | ||
52 | |||
53 | |||
54 | static int string_checker_helper(const char *p1, const char *p2) __attribute__ ((__pure__)); | 49 | static int string_checker_helper(const char *p1, const char *p2) __attribute__ ((__pure__)); |
55 | 50 | ||
56 | static int string_checker_helper(const char *p1, const char *p2) | 51 | static int string_checker_helper(const char *p1, const char *p2) |
@@ -101,12 +96,12 @@ static const char *obscure_msg(const char *old_p, const char *new_p, const struc | |||
101 | int length; | 96 | int length; |
102 | int mixed = 0; | 97 | int mixed = 0; |
103 | /* Add 1 for each type of characters to the minlen of password */ | 98 | /* Add 1 for each type of characters to the minlen of password */ |
104 | int size = MINLEN + 8; | 99 | int size = CONFIG_PASSWORD_MINLEN + 8; |
105 | const char *p; | 100 | const char *p; |
106 | char hostname[255]; | 101 | char hostname[255]; |
107 | 102 | ||
108 | /* size */ | 103 | /* size */ |
109 | if (!new_p || (length = strlen(new_p)) < MINLEN) | 104 | if (!new_p || (length = strlen(new_p)) < CONFIG_PASSWORD_MINLEN) |
110 | return("too short"); | 105 | return("too short"); |
111 | 106 | ||
112 | /* no username as-is, as sub-string, reversed, capitalized, doubled */ | 107 | /* no username as-is, as sub-string, reversed, capitalized, doubled */ |