summaryrefslogtreecommitdiff
path: root/source3/smbd/chgpasswd.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2009-01-08 12:27:52 +0100
committerJelmer Vernooij <jelmer@samba.org>2009-01-08 12:27:52 +0100
commit3318204d294f3b3ac3409f192edc3eddeada245b (patch)
tree442f52cc0c9bae0378c228c85166bcd005e60336 /source3/smbd/chgpasswd.c
parentba5d6e6d706ebf07640ee24d701255cbb4803525 (diff)
parent3dde0cbb769b92d922be13677ad076cae9b6a693 (diff)
downloadsamba-3318204d294f3b3ac3409f192edc3eddeada245b.tar.gz
samba-3318204d294f3b3ac3409f192edc3eddeada245b.tar.bz2
samba-3318204d294f3b3ac3409f192edc3eddeada245b.zip
Merge branch 'master' of ssh://git.samba.org/data/git/samba
Diffstat (limited to 'source3/smbd/chgpasswd.c')
-rw-r--r--source3/smbd/chgpasswd.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/source3/smbd/chgpasswd.c b/source3/smbd/chgpasswd.c
index e6d2bbf59f..78bace7e92 100644
--- a/source3/smbd/chgpasswd.c
+++ b/source3/smbd/chgpasswd.c
@@ -712,7 +712,7 @@ bool check_lanman_password(char *user, uchar * pass1,
bool change_lanman_password(struct samu *sampass, uchar *pass2)
{
- static uchar null_pw[16];
+ uchar null_pw[16];
uchar unenc_new_pw[16];
bool ret;
uint32 acct_ctrl;
@@ -735,20 +735,21 @@ bool change_lanman_password(struct samu *sampass, uchar *pass2)
if (pwd == NULL) {
if (acct_ctrl & ACB_PWNOTREQ) {
uchar no_pw[14];
- memset(no_pw, '\0', 14);
+
+ ZERO_STRUCT(no_pw);
+
E_P16(no_pw, null_pw);
- /* Get the new lanman hash. */
- D_P16(null_pw, pass2, unenc_new_pw);
+ pwd = null_pw;
} else {
DEBUG(0,("change_lanman_password: no lanman password !\n"));
return False;
}
- } else {
- /* Get the new lanman hash. */
- D_P16(pwd, pass2, unenc_new_pw);
}
+ /* Get the new lanman hash. */
+ D_P16(pwd, pass2, unenc_new_pw);
+
if (!pdb_set_lanman_passwd(sampass, unenc_new_pw, PDB_CHANGED)) {
return False;
}
@@ -826,8 +827,8 @@ static NTSTATUS check_oem_password(const char *user,
struct samu **hnd,
char **pp_new_passwd)
{
- static uchar null_pw[16];
- static uchar null_ntpw[16];
+ uchar null_pw[16];
+ uchar null_ntpw[16];
struct samu *sampass = NULL;
uint8 *password_encrypted;
const uint8 *encryption_key;