From 3141a266777dac9378c2bbbdf5ed591c220604ec Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 30 Jan 2004 14:59:40 +0000 Subject: disable any account that doesn't have a password and doesn't had the ACB_PWNOTREQ bit set (This used to be commit 52bf070b10ca99be7e4b9d1b5e32f69d2667d8f4) --- source3/passdb/pdb_interface.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'source3/passdb') 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); } -- cgit