diff options
author | Andrew Bartlett <abartlet@samba.org> | 2013-06-03 10:02:39 +1000 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2013-06-11 08:35:21 -0400 |
commit | 26279a969879bfbd943dfda03c511ed7e14057ba (patch) | |
tree | d8510cc1e4d9bec8b036421e514b401b56a018c9 /source3/auth | |
parent | 3fba9ba7ea85e33faac2718d2463c5d0cd2d85f4 (diff) | |
download | samba-26279a969879bfbd943dfda03c511ed7e14057ba.tar.gz samba-26279a969879bfbd943dfda03c511ed7e14057ba.tar.bz2 samba-26279a969879bfbd943dfda03c511ed7e14057ba.zip |
auth: Remove "password level"
We now only lowercase the password, we do not attempt to find another case
combination that the password might be in.
This option is already depricated, so it is now time to remove it.
Andrew Bartlett
Reviewed-by: Simo Sorce <idra@samba.org>
Diffstat (limited to 'source3/auth')
-rw-r--r-- | source3/auth/pass_check.c | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/source3/auth/pass_check.c b/source3/auth/pass_check.c index f2d1fc241b..21694b3d55 100644 --- a/source3/auth/pass_check.c +++ b/source3/auth/pass_check.c @@ -494,68 +494,6 @@ static char *osf1_bigcrypt(char *password, char *salt1) /**************************************************************************** -apply a function to upper/lower case combinations -of a string and return true if one of them returns true. -try all combinations with N uppercase letters. -offset is the first char to try and change (start with 0) -it assumes the string starts lowercased -****************************************************************************/ -static NTSTATUS string_combinations2(char *s, int offset, - NTSTATUS (*fn)(const char *s, - const void *private_data), - int N, const void *private_data) -{ - int len = strlen(s); - int i; - NTSTATUS nt_status; - -#ifdef PASSWORD_LENGTH - len = MIN(len, PASSWORD_LENGTH); -#endif - - if (N <= 0 || offset >= len) - return (fn(s, private_data)); - - for (i = offset; i < (len - (N - 1)); i++) { - char c = s[i]; - if (!islower_m(c)) - continue; - s[i] = toupper_m(c); - nt_status = string_combinations2(s, i + 1, fn, N - 1, - private_data); - if (!NT_STATUS_EQUAL(nt_status, NT_STATUS_WRONG_PASSWORD)) { - return nt_status; - } - s[i] = c; - } - return (NT_STATUS_WRONG_PASSWORD); -} - -/**************************************************************************** -apply a function to upper/lower case combinations -of a string and return true if one of them returns true. -try all combinations with up to N uppercase letters. -offset is the first char to try and change (start with 0) -it assumes the string starts lowercased -****************************************************************************/ -static NTSTATUS string_combinations(char *s, - NTSTATUS (*fn)(const char *s, - const void *private_data), - int N, const void *private_data) -{ - int n; - NTSTATUS nt_status; - for (n = 1; n <= N; n++) { - nt_status = string_combinations2(s, 0, fn, n, private_data); - if (!NT_STATUS_EQUAL(nt_status, NT_STATUS_WRONG_PASSWORD)) { - return nt_status; - } - } - return NT_STATUS_WRONG_PASSWORD; -} - - -/**************************************************************************** core of password checking routine ****************************************************************************/ static NTSTATUS password_check(const char *password, const void *private_data) @@ -673,7 +611,6 @@ NTSTATUS pass_check(const struct passwd *pass, bool run_cracker) { char *pass2 = NULL; - int level = lp_passwordlevel(); NTSTATUS nt_status; @@ -876,21 +813,5 @@ NTSTATUS pass_check(const struct passwd *pass, } } - /* give up? */ - if (level < 1) { - return NT_STATUS_WRONG_PASSWORD; - } - - /* last chance - all combinations of up to level chars upper! */ - if (!strlower_m(pass2)) { - return NT_STATUS_INVALID_PARAMETER; - } - - nt_status = string_combinations(pass2, password_check, level, - (const void *)rhost); - if (NT_STATUS_IS_OK(nt_status)) { - return nt_status; - } - return NT_STATUS_WRONG_PASSWORD; } |