From 087b9d640ed66f37249c09885fa86b27a78554c7 Mon Sep 17 00:00:00 2001 From: "\"Robert P. J. Day\"" Date: Sun, 2 Jul 2006 18:35:39 +0000 Subject: Allow a user-configurable minimum password length. --- libbb/obscure.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'libbb/obscure.c') 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 @@ #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 @@ static const char *obscure_msg(const char *old_p, const char *new_p, const struc 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 */ -- cgit v1.2.3