summaryrefslogtreecommitdiff
path: root/source3/passdb/pdb_get_set.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2002-03-02 10:16:28 +0000
committerAndrew Bartlett <abartlet@samba.org>2002-03-02 10:16:28 +0000
commit2ef9be9a99cbd4b3c5076433153d675aa0cd4ca2 (patch)
tree2cd36969e8d97fbf8f18bd8f0593bc2298bc163e /source3/passdb/pdb_get_set.c
parentf4f43fc9401a5c681ec7cd18564dbad3a1d8cd08 (diff)
downloadsamba-2ef9be9a99cbd4b3c5076433153d675aa0cd4ca2.tar.gz
samba-2ef9be9a99cbd4b3c5076433153d675aa0cd4ca2.tar.bz2
samba-2ef9be9a99cbd4b3c5076433153d675aa0cd4ca2.zip
This patch merges my private LDAP tree into HEAD.
The main change here is to move ldap into the new pluggable passdb subsystem and to take the LDAP location as a 'location' paramter on the 'passdb backend' line in the smb.conf. This is an LDAP URL, parsed by OpenLDAP where supported, and by hand where it isn't. It also adds the ldap user suffix and ldap machine suffix smb.conf options, so that machines added to the LDAP dir don't get mixed in with people. Non-unix account support is also added. This means that machines don't need to be in /etc/passwd or in nss_ldap's scope. This code has stood up well under my production environment, so it relitivly well tested. I'm commiting this now becouse others have shown interest in using it, and there is no point 'hording' the code :-). Andrew Bartlett (This used to be commit cd5234d7dd7309d88944b83d807c1f1c2ca0460a)
Diffstat (limited to 'source3/passdb/pdb_get_set.c')
-rw-r--r--source3/passdb/pdb_get_set.c35
1 files changed, 28 insertions, 7 deletions
diff --git a/source3/passdb/pdb_get_set.c b/source3/passdb/pdb_get_set.c
index 5886d29c67..181364ab6b 100644
--- a/source3/passdb/pdb_get_set.c
+++ b/source3/passdb/pdb_get_set.c
@@ -321,48 +321,68 @@ BOOL pdb_set_acct_ctrl (SAM_ACCOUNT *sampass, uint16 flags)
return False;
}
-BOOL pdb_set_logon_time (SAM_ACCOUNT *sampass, time_t mytime)
+BOOL pdb_set_logon_time (SAM_ACCOUNT *sampass, time_t mytime, BOOL store)
{
if (!sampass)
return False;
sampass->private.logon_time = mytime;
+
+ if (store)
+ pdb_set_init_flag(sampass, FLAG_SAM_LOGONTIME);
+
return True;
}
-BOOL pdb_set_logoff_time (SAM_ACCOUNT *sampass, time_t mytime)
+BOOL pdb_set_logoff_time (SAM_ACCOUNT *sampass, time_t mytime, BOOL store)
{
if (!sampass)
return False;
sampass->private.logoff_time = mytime;
+
+ if (store)
+ pdb_set_init_flag(sampass, FLAG_SAM_LOGOFFTIME);
+
return True;
}
-BOOL pdb_set_kickoff_time (SAM_ACCOUNT *sampass, time_t mytime)
+BOOL pdb_set_kickoff_time (SAM_ACCOUNT *sampass, time_t mytime, BOOL store)
{
if (!sampass)
return False;
sampass->private.kickoff_time = mytime;
+
+ if (store)
+ pdb_set_init_flag(sampass, FLAG_SAM_KICKOFFTIME);
+
return True;
}
-BOOL pdb_set_pass_can_change_time (SAM_ACCOUNT *sampass, time_t mytime)
+BOOL pdb_set_pass_can_change_time (SAM_ACCOUNT *sampass, time_t mytime, BOOL store)
{
if (!sampass)
return False;
sampass->private.pass_can_change_time = mytime;
+
+ if (store)
+ pdb_set_init_flag(sampass, FLAG_SAM_CANCHANGETIME);
+
return True;
}
-BOOL pdb_set_pass_must_change_time (SAM_ACCOUNT *sampass, time_t mytime)
+BOOL pdb_set_pass_must_change_time (SAM_ACCOUNT *sampass, time_t mytime, BOOL store)
{
if (!sampass)
return False;
sampass->private.pass_must_change_time = mytime;
+
+ if (store)
+ pdb_set_init_flag(sampass, FLAG_SAM_MUSTCHANGETIME);
+
return True;
}
@@ -372,6 +392,7 @@ BOOL pdb_set_pass_last_set_time (SAM_ACCOUNT *sampass, time_t mytime)
return False;
sampass->private.pass_last_set_time = mytime;
+
return True;
}
@@ -876,12 +897,12 @@ BOOL pdb_set_pass_changed_now (SAM_ACCOUNT *sampass)
account_policy_get(AP_MAX_PASSWORD_AGE, &expire);
if (expire==(uint32)-1) {
- if (!pdb_set_pass_must_change_time (sampass, 0))
+ if (!pdb_set_pass_must_change_time (sampass, get_time_t_max(), False))
return False;
} else {
if (!pdb_set_pass_must_change_time (sampass,
pdb_get_pass_last_set_time(sampass)
- + expire))
+ + expire, True))
return False;
}