summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/ldap.c2
-rw-r--r--source3/passdb/passdb.c2
-rw-r--r--source3/passdb/smbpass.c10
3 files changed, 12 insertions, 2 deletions
diff --git a/source3/passdb/ldap.c b/source3/passdb/ldap.c
index 80ba6be3a7..59c6cd3d4f 100644
--- a/source3/passdb/ldap.c
+++ b/source3/passdb/ldap.c
@@ -708,7 +708,7 @@ static BOOL modadd_ldap21pwd_entry(struct sam_passwd *newpwd, int flag)
make_a_mod(&mods, ldap_state, "rid", rid);
make_a_mod(&mods, ldap_state, "pwdLastSet", lst);
- make_a_mod(&mods, ldap_state, "userAccountControl", pdb_encode_acct_ctrl(newpwd->acct_ctrl));
+ make_a_mod(&mods, ldap_state, "userAccountControl", pdb_encode_acct_ctrl(newpwd->acct_ctrl,NEW_PW_FORMAT_SPACE_PADDED_LEN));
ldap_modify_s(ldap_struct, dn, mods);
diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c
index 6633088245..15b2e8ed50 100644
--- a/source3/passdb/passdb.c
+++ b/source3/passdb/passdb.c
@@ -558,7 +558,7 @@ uint16 pdb_decode_acct_ctrl(char *p)
case 'L': { acct_ctrl |= ACB_AUTOLOCK ; break; /* 'L'ocked account. */ }
case 'X': { acct_ctrl |= ACB_PWNOEXP ; break; /* No 'X'piry on password */ }
case 'I': { acct_ctrl |= ACB_DOMTRUST ; break; /* 'I'nterdomain trust account. */ }
- case ' ':
+ case ' ': { break; }
case ':':
case '\n':
case '\0':
diff --git a/source3/passdb/smbpass.c b/source3/passdb/smbpass.c
index cff049dcd5..e67a9c9768 100644
--- a/source3/passdb/smbpass.c
+++ b/source3/passdb/smbpass.c
@@ -770,6 +770,16 @@ static BOOL mod_smbfilepwd_entry(struct smb_passwd* pwd, BOOL override)
p += 33; /* Move to the first character of the line after
the NT password. */
+ /*
+ * If both NT and lanman passwords are provided - reset password
+ * not required flag.
+ */
+
+ if(pwd->smb_passwd != NULL || pwd->smb_nt_passwd != NULL) {
+ /* Reqiure password in the future (should ACB_DISABLED also be reset?) */
+ pwd->acct_ctrl &= ~(ACB_PWNOTREQ);
+ }
+
if (*p == '[') {
i = 0;