diff options
author | Jeremy Allison <jra@samba.org> | 1998-10-15 00:55:17 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 1998-10-15 00:55:17 +0000 |
commit | fc7d3e4caa7650c02ef36fff83b64b06050f66b1 (patch) | |
tree | 8fbe7f4ec700a5f2f42397683783e7d19249337a /source3/smbd/password.c | |
parent | bc747b8a077d22344aa03bbba202f5137b59284d (diff) | |
download | samba-fc7d3e4caa7650c02ef36fff83b64b06050f66b1.tar.gz samba-fc7d3e4caa7650c02ef36fff83b64b06050f66b1.tar.bz2 samba-fc7d3e4caa7650c02ef36fff83b64b06050f66b1.zip |
config: Fix crypt prototype on RedHat Linux.
include/includes.h: Fix crypt prototype on RedHat Linux.
smbd/fileio.c: Fix mmap bug found by WinCE client.
smbd/ipc.c: Fix WinCE wierdness with pipes being opened as \server\pipe\lanman
smbd/password.c: Fix encrypted null passwords.
Jeremy.
(This used to be commit 475992730c0ecbf31c09b3518df2f0354cec61da)
Diffstat (limited to 'source3/smbd/password.c')
-rw-r--r-- | source3/smbd/password.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/source3/smbd/password.c b/source3/smbd/password.c index 49ad4a514f..761313b688 100644 --- a/source3/smbd/password.c +++ b/source3/smbd/password.c @@ -379,6 +379,7 @@ BOOL smb_password_check(char *password, unsigned char *part_passwd, unsigned cha Do a specific test for an smb password being correct, given a smb_password and the lanman and NT responses. ****************************************************************************/ + BOOL smb_password_ok(struct smb_passwd *smb_pass, uchar lm_pass[24], uchar nt_pass[24]) { @@ -386,6 +387,9 @@ BOOL smb_password_ok(struct smb_passwd *smb_pass, if (!lm_pass || !smb_pass) return(False); + DEBUG(4,("Checking SMB password for user %s\n", + smb_pass->smb_name)); + if(smb_pass->acct_ctrl & ACB_DISABLED) { DEBUG(3,("account for user %s was disabled.\n", smb_pass->smb_name)); @@ -397,9 +401,6 @@ BOOL smb_password_ok(struct smb_passwd *smb_pass, return False; } - DEBUG(4,("Checking SMB password for user %s\n", - smb_pass->smb_name)); - if ((Protocol >= PROTOCOL_NT1) && (smb_pass->smb_nt_passwd != NULL)) { /* We have the NT MD4 hash challenge available - see if we can use it (ie. does it exist in the smbpasswd file). @@ -493,6 +494,11 @@ static BOOL pass_check_smb(char *user,char *password, struct passwd *pwd) return(False); } + if(password[0] == '\0' && smb_pass->acct_ctrl & ACB_PWNOTREQ && lp_null_passwords()) { + DEBUG(3,("account for user %s has no password and null passwords are allowed.\n", smb_pass->smb_name)); + return(True); + } + if (smb_password_ok(smb_pass, (unsigned char *)password, (uchar *)password)) { @@ -510,7 +516,7 @@ return True if the password is correct, False otherwise ****************************************************************************/ BOOL password_ok(char *user,char *password, int pwlen, struct passwd *pwd) { - if (pwlen == 24) { + if (pwlen == 24 || (lp_encrypted_passwords() && (pwlen == 0) && lp_null_passwords())) { /* if it is 24 bytes long then assume it is an encrypted password */ return pass_check_smb(user, password, pwd); |