From 799d5494c744acadbe47b02de6a67ffa6dcf892d Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 30 Jan 2004 15:00:57 +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 6c4de7198b94a8cea176e1c9d86deb65705f9058) --- source3/passdb/pdb_interface.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'source3/passdb/pdb_interface.c') diff --git a/source3/passdb/pdb_interface.c b/source3/passdb/pdb_interface.c index 2640e5bfe4..8c93aaae1e 100644 --- a/source3/passdb/pdb_interface.c +++ b/source3/passdb/pdb_interface.c @@ -819,12 +819,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); } @@ -842,11 +845,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