diff options
author | Gerald Carter <jerry@samba.org> | 2004-01-30 14:59:40 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2004-01-30 14:59:40 +0000 |
commit | 3141a266777dac9378c2bbbdf5ed591c220604ec (patch) | |
tree | bece17f2a177d250e27a440cb8f1b67a1b0418de | |
parent | d4420dc9023677461570eaedd1f1ca0e6c0ef758 (diff) | |
download | samba-3141a266777dac9378c2bbbdf5ed591c220604ec.tar.gz samba-3141a266777dac9378c2bbbdf5ed591c220604ec.tar.bz2 samba-3141a266777dac9378c2bbbdf5ed591c220604ec.zip |
disable any account that doesn't have a password and doesn't had the ACB_PWNOTREQ bit set
(This used to be commit 52bf070b10ca99be7e4b9d1b5e32f69d2667d8f4)
-rw-r--r-- | source3/passdb/pdb_interface.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/source3/passdb/pdb_interface.c b/source3/passdb/pdb_interface.c index c656e08722..e88b58f1e2 100644 --- a/source3/passdb/pdb_interface.c +++ b/source3/passdb/pdb_interface.c @@ -714,12 +714,15 @@ BOOL pdb_add_sam_account(SAM_ACCOUNT *sam_acct) if (!pdb_context) { return False; } + + /* disable acccounts with no passwords (that has not + been allowed by the ACB_PWNOTREQ bit */ - /* disable acccounts with no passwords */ lm_pw = pdb_get_lanman_passwd( sam_acct ); nt_pw = pdb_get_lanman_passwd( sam_acct ); - if ( !lm_pw || !nt_pw ) { - acb_flags = pdb_get_acct_ctrl( sam_acct ) | ACB_DISABLED; + acb_flags = pdb_get_acct_ctrl( sam_acct ); + if ( !lm_pw && !nt_pw && !(acb_flags&ACB_PWNOTREQ) ) { + acb_flags |= ACB_DISABLED; pdb_set_acct_ctrl( sam_acct, acb_flags, PDB_SET ); pdb_set_init_flags(sam_acct, PDB_ACCTCTRL, PDB_SET); } @@ -737,11 +740,14 @@ BOOL pdb_update_sam_account(SAM_ACCOUNT *sam_acct) return False; } - /* disable acccounts with no passwords */ + /* disable acccounts with no passwords (that has not + been allowed by the ACB_PWNOTREQ bit */ + lm_pw = pdb_get_lanman_passwd( sam_acct ); nt_pw = pdb_get_lanman_passwd( sam_acct ); - if ( !lm_pw || !nt_pw ) { - acb_flags = pdb_get_acct_ctrl( sam_acct ) | ACB_DISABLED; + acb_flags = pdb_get_acct_ctrl( sam_acct ); + if ( !lm_pw && !nt_pw && !(acb_flags&ACB_PWNOTREQ) ) { + acb_flags |= ACB_DISABLED; pdb_set_acct_ctrl( sam_acct, acb_flags, PDB_SET ); pdb_set_init_flags(sam_acct, PDB_ACCTCTRL, PDB_SET); } |