summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2004-01-30 15:00:57 +0000
committerGerald Carter <jerry@samba.org>2004-01-30 15:00:57 +0000
commit799d5494c744acadbe47b02de6a67ffa6dcf892d (patch)
treea4ffb3126627a0815a30a341e95fe3de9040cf6c /source3/passdb
parent69605c14abfa9a98e5b162d582e2f3d03c5cc4df (diff)
downloadsamba-799d5494c744acadbe47b02de6a67ffa6dcf892d.tar.gz
samba-799d5494c744acadbe47b02de6a67ffa6dcf892d.tar.bz2
samba-799d5494c744acadbe47b02de6a67ffa6dcf892d.zip
disable any account that doesn't have a password and doesn't had the ACB_PWNOTREQ bit set
(This used to be commit 6c4de7198b94a8cea176e1c9d86deb65705f9058)
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/pdb_interface.c18
1 files changed, 12 insertions, 6 deletions
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);
}