summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-03-27 00:24:40 +0000
committerJeremy Allison <jra@samba.org>2001-03-27 00:24:40 +0000
commitbcdb9496e81c4d00a522ce57406dec08f6df9b34 (patch)
treef7738baa8e8010fc468a9e472cbbd18615d40fb7
parent85cab6559e8f025582366a626255c7ccd9c7bacd (diff)
downloadsamba-bcdb9496e81c4d00a522ce57406dec08f6df9b34.tar.gz
samba-bcdb9496e81c4d00a522ce57406dec08f6df9b34.tar.bz2
samba-bcdb9496e81c4d00a522ce57406dec08f6df9b34.zip
Bail out early if null passwords and lp_null_passwords not set.
Jeremy. (This used to be commit 7c718fc85e3dbfaf0195e352d06a8c682a6036fc)
-rw-r--r--source3/smbd/password.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source3/smbd/password.c b/source3/smbd/password.c
index 12f7385f06..fa973dd720 100644
--- a/source3/smbd/password.c
+++ b/source3/smbd/password.c
@@ -586,6 +586,11 @@ return True if the password is correct, False otherwise
****************************************************************************/
BOOL password_ok(char *user, char *password, int pwlen, struct passwd *pwd)
{
+ if ((pwlen == 0) && !lp_null_passwords()) {
+ DEBUG(4,("Null passwords not allowed.\n"));
+ return False;
+ }
+
if (pwlen == 24 || (lp_encrypted_passwords() && (pwlen == 0) && lp_null_passwords()))
{
/* if 24 bytes long assume it is an encrypted password */