summaryrefslogtreecommitdiffstats
path: root/source3/passdb
diff options
context:
space:
mode:
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/nispass.c10
-rw-r--r--source3/passdb/passdb.c40
2 files changed, 42 insertions, 8 deletions
diff --git a/source3/passdb/nispass.c b/source3/passdb/nispass.c
index a61d38c1ec..7ef7ec3093 100644
--- a/source3/passdb/nispass.c
+++ b/source3/passdb/nispass.c
@@ -239,14 +239,14 @@ static BOOL add_nisp21pwd_entry(struct sam_passwd *newpwd)
fstring logon_t;
fstring logoff_t;
- fstring kick_t;
+ fstring kickoff_t;
fstring pwdlset_t;
fstring pwdlchg_t;
fstring pwdmchg_t;
bzero(logon_t , sizeof(logon_t ));
bzero(logoff_t , sizeof(logoff_t ));
- bzero(kick_t , sizeof(kick_t ));
+ bzero(kickoff_t, sizeof(kickoff_t));
bzero(pwdlset_t, sizeof(pwdlset_t));
bzero(pwdlchg_t, sizeof(pwdlchg_t));
bzero(pwdmchg_t, sizeof(pwdmchg_t));
@@ -313,16 +313,12 @@ static BOOL add_nisp21pwd_entry(struct sam_passwd *newpwd)
pdb_sethexpwd(smb_passwd , newpwd->smb_passwd , newpwd->acct_ctrl);
pdb_sethexpwd(smb_nt_passwd, newpwd->smb_nt_passwd, newpwd->acct_ctrl);
-#if 0
pdb_set_logon_time (logon_t , sizeof(logon_t ), newpwd->logon_time );
pdb_set_logoff_time (logoff_t , sizeof(logoff_t ), newpwd->logoff_time );
pdb_set_kickoff_time (kickoff_t, sizeof(kickoff_t), newpwd->kickoff_time );
-#endif
pdb_set_last_set_time (pwdlset_t, sizeof(pwdlset_t), newpwd->pass_last_set_time );
-#if 0
pdb_set_can_change_time (pwdlchg_t, sizeof(pwdlchg_t), newpwd->pass_can_change_time );
pdb_set_must_change_time(pwdmchg_t, sizeof(pwdmchg_t), newpwd->pass_must_change_time);
-#endif
slprintf(uid, sizeof(uid), "%u", newpwd->smb_userid);
slprintf(user_rid, sizeof(user_rid), "0x%x", newpwd->user_rid);
@@ -341,7 +337,7 @@ static BOOL add_nisp21pwd_entry(struct sam_passwd *newpwd)
set_single_attribute(&new_obj, NPF_NTPWD , smb_nt_passwd , strlen(smb_nt_passwd) , EN_CRYPT);
set_single_attribute(&new_obj, NPF_LOGON_T , logon_t , strlen(logon_t) , 0);
set_single_attribute(&new_obj, NPF_LOGOFF_T , logoff_t , strlen(logoff_t) , 0);
- set_single_attribute(&new_obj, NPF_KICK_T , kick_t , strlen(kick_t) , 0);
+ set_single_attribute(&new_obj, NPF_KICK_T , kickoff_t , strlen(kickoff_t) , 0);
set_single_attribute(&new_obj, NPF_PWDLSET_T , pwdlset_t , strlen(pwdlset_t) , 0);
set_single_attribute(&new_obj, NPF_PWDLCHG_T , pwdlchg_t , strlen(pwdlchg_t) , 0);
set_single_attribute(&new_obj, NPF_PWDMCHG_T , pwdmchg_t , strlen(pwdmchg_t) , 0);
diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c
index 47811a3938..fa4a39e836 100644
--- a/source3/passdb/passdb.c
+++ b/source3/passdb/passdb.c
@@ -635,16 +635,54 @@ time_t pdb_get_last_set_time(char *p)
/*******************************************************************
sets password-database-format time in a string.
********************************************************************/
-
static void set_time_in_string(char *p, int max_len, char *type, time_t t)
{
slprintf(p, max_len, ":%s-%08X:", type, (uint32)t);
}
/*******************************************************************
+ sets logon time
+ ********************************************************************/
+void pdb_set_logon_time(char *p, int max_len, time_t t)
+{
+ set_time_in_string(p, max_len, "LNT", t);
+}
+
+/*******************************************************************
+ sets logoff time
+ ********************************************************************/
+void pdb_set_logoff_time(char *p, int max_len, time_t t)
+{
+ set_time_in_string(p, max_len, "LOT", t);
+}
+
+/*******************************************************************
+ sets kickoff time
+ ********************************************************************/
+void pdb_set_kickoff_time(char *p, int max_len, time_t t)
+{
+ set_time_in_string(p, max_len, "KOT", t);
+}
+
+/*******************************************************************
+ sets password can change time
+ ********************************************************************/
+void pdb_set_can_change_time(char *p, int max_len, time_t t)
+{
+ set_time_in_string(p, max_len, "CCT", t);
+}
+
+/*******************************************************************
sets password last set time
********************************************************************/
+void pdb_set_must_change_time(char *p, int max_len, time_t t)
+{
+ set_time_in_string(p, max_len, "MCT", t);
+}
+/*******************************************************************
+ sets password last set time
+ ********************************************************************/
void pdb_set_last_set_time(char *p, int max_len, time_t t)
{
set_time_in_string(p, max_len, "LCT", t);