summaryrefslogtreecommitdiff
path: root/source3/passdb/pdb_interface.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2004-01-29 22:17:27 +0000
committerGerald Carter <jerry@samba.org>2004-01-29 22:17:27 +0000
commit69605c14abfa9a98e5b162d582e2f3d03c5cc4df (patch)
tree4e05cdbd76f8756f78ef2d669214e0a77699fc96 /source3/passdb/pdb_interface.c
parent90c2090116606cd1ac817a238b60a8321d67fa5d (diff)
downloadsamba-69605c14abfa9a98e5b162d582e2f3d03c5cc4df.tar.gz
samba-69605c14abfa9a98e5b162d582e2f3d03c5cc4df.tar.bz2
samba-69605c14abfa9a98e5b162d582e2f3d03c5cc4df.zip
more initialization fixes
(This used to be commit 63206b1204bd532bf99912cd4312baf7d69db1f6)
Diffstat (limited to 'source3/passdb/pdb_interface.c')
-rw-r--r--source3/passdb/pdb_interface.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/source3/passdb/pdb_interface.c b/source3/passdb/pdb_interface.c
index 1087624aca..2640e5bfe4 100644
--- a/source3/passdb/pdb_interface.c
+++ b/source3/passdb/pdb_interface.c
@@ -813,22 +813,44 @@ BOOL pdb_getsampwsid(SAM_ACCOUNT *sam_acct, const DOM_SID *sid)
BOOL pdb_add_sam_account(SAM_ACCOUNT *sam_acct)
{
struct pdb_context *pdb_context = pdb_get_static_context(False);
+ const char *lm_pw, *nt_pw;
+ uint16 acb_flags;
if (!pdb_context) {
return False;
}
+ /* 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;
+ pdb_set_acct_ctrl( sam_acct, acb_flags, PDB_SET );
+ pdb_set_init_flags(sam_acct, PDB_ACCTCTRL, PDB_SET);
+ }
+
return NT_STATUS_IS_OK(pdb_context->pdb_add_sam_account(pdb_context, sam_acct));
}
BOOL pdb_update_sam_account(SAM_ACCOUNT *sam_acct)
{
struct pdb_context *pdb_context = pdb_get_static_context(False);
+ const char *lm_pw, *nt_pw;
+ uint16 acb_flags;
if (!pdb_context) {
return False;
}
+ /* 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;
+ pdb_set_acct_ctrl( sam_acct, acb_flags, PDB_SET );
+ pdb_set_init_flags(sam_acct, PDB_ACCTCTRL, PDB_SET);
+ }
+
return NT_STATUS_IS_OK(pdb_context->pdb_update_sam_account(pdb_context, sam_acct));
}