1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-04 17:47:26 +03:00

disable any account that doesn't have a password and doesn't had the ACB_PWNOTREQ bit set

(This used to be commit 52bf070b10ca99be7e4b9d1b5e32f69d2667d8f4)
This commit is contained in:
Gerald Carter 2004-01-30 14:59:40 +00:00
parent d4420dc902
commit 3141a26677

View File

@ -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);
}