diff options
Diffstat (limited to 'source3/passdb')
-rw-r--r-- | source3/passdb/passdb.c | 11 | ||||
-rw-r--r-- | source3/passdb/pdb_nisplus.c | 12 | ||||
-rw-r--r-- | source3/passdb/pdb_smbpasswd.c | 24 |
3 files changed, 22 insertions, 25 deletions
diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c index b1e1e2b989..96c11de73a 100644 --- a/source3/passdb/passdb.c +++ b/source3/passdb/passdb.c @@ -77,11 +77,11 @@ static BOOL pdb_fill_default_sam(SAM_ACCOUNT *user) ZERO_STRUCTP(user); user->logon_time = (time_t)0; - user->logoff_time = (time_t)0; - user->kickoff_time = (time_t)0; - user->pass_last_set_time = (time_t)0; - user->pass_can_change_time = (time_t)0; - user->pass_must_change_time = (time_t)0; + user->logoff_time = + user->kickoff_time = + user->pass_last_set_time = + user->pass_can_change_time = + user->pass_must_change_time = get_time_t_max(); user->unknown_3 = 0x00ffffff; /* don't know */ user->logon_divs = 168; /* hours per week */ @@ -140,7 +140,6 @@ BOOL pdb_init_sam_pw(SAM_ACCOUNT **new_sam_acct, struct passwd *pwd) pdb_set_fullname(*new_sam_acct, pwd->pw_gecos); pdb_set_uid(*new_sam_acct, pwd->pw_uid); pdb_set_gid(*new_sam_acct, pwd->pw_gid); - pdb_set_pass_last_set_time(*new_sam_acct, time(NULL)); pdb_set_profile_path(*new_sam_acct, lp_logon_path()); pdb_set_homedir(*new_sam_acct, lp_logon_home()); pdb_set_dir_drive(*new_sam_acct, lp_logon_drive()); diff --git a/source3/passdb/pdb_nisplus.c b/source3/passdb/pdb_nisplus.c index 5bb94c90b7..b73072015b 100644 --- a/source3/passdb/pdb_nisplus.c +++ b/source3/passdb/pdb_nisplus.c @@ -209,7 +209,7 @@ static BOOL make_sam_from_nisp_object(SAM_ACCOUNT *pw_buf, nis_object *obj) * time values. note: this code assumes 32bit time_t! */ - pdb_set_logon_time(pw_buf, -1); + pdb_set_logon_time(pw_buf, get_time_t_max()); ptr = (uchar *)ENTRY_VAL(obj, NPF_LOGON_T); if(ptr && *ptr && (StrnCaseCmp(ptr, "LNT-", 4)==0)) { int i; @@ -223,7 +223,7 @@ static BOOL make_sam_from_nisp_object(SAM_ACCOUNT *pw_buf, nis_object *obj) } } - pdb_set_logoff_time(pw_buf, -1); + pdb_set_logoff_time(pw_buf, get_time_t_max()); ptr = (uchar *)ENTRY_VAL(obj, NPF_LOGOFF_T); if(ptr && *ptr && (StrnCaseCmp(ptr, "LOT-", 4)==0)) { int i; @@ -237,7 +237,7 @@ static BOOL make_sam_from_nisp_object(SAM_ACCOUNT *pw_buf, nis_object *obj) } } - pdb_set_kickoff_time(pw_buf, -1); + pdb_set_kickoff_time(pw_buf, get_time_t_max()); ptr = (uchar *)ENTRY_VAL(obj, NPF_KICK_T); if(ptr && *ptr && (StrnCaseCmp(ptr, "KOT-", 4)==0)) { int i; @@ -251,7 +251,7 @@ static BOOL make_sam_from_nisp_object(SAM_ACCOUNT *pw_buf, nis_object *obj) } } - pdb_set_pass_last_set_time(pw_buf, -1); + pdb_set_pass_last_set_time(pw_buf, get_time_t_max()); ptr = (uchar *)ENTRY_VAL(obj, NPF_PWDLSET_T); if(ptr && *ptr && (StrnCaseCmp(ptr, "LCT-", 4)==0)) { int i; @@ -265,7 +265,7 @@ static BOOL make_sam_from_nisp_object(SAM_ACCOUNT *pw_buf, nis_object *obj) } } - pdb_set_pass_can_change_time(pw_buf, -1); + pdb_set_pass_can_change_time(pw_buf, get_time_t_max()); ptr = (uchar *)ENTRY_VAL(obj, NPF_PWDCCHG_T); if(ptr && *ptr && (StrnCaseCmp(ptr, "CCT-", 4)==0)) { int i; @@ -279,7 +279,7 @@ static BOOL make_sam_from_nisp_object(SAM_ACCOUNT *pw_buf, nis_object *obj) } } - pdb_set_pass_must_change_time(pw_buf, -1); + pdb_set_pass_must_change_time(pw_buf, get_time_t_max()); ptr = (uchar *)ENTRY_VAL(obj, NPF_PWDMCHG_T); if(ptr && *ptr && (StrnCaseCmp(ptr, "MCT-", 4)==0)) { int i; diff --git a/source3/passdb/pdb_smbpasswd.c b/source3/passdb/pdb_smbpasswd.c index b01f03e124..7d14d3e0e0 100644 --- a/source3/passdb/pdb_smbpasswd.c +++ b/source3/passdb/pdb_smbpasswd.c @@ -101,17 +101,16 @@ static BOOL pw_file_unlock(int fd, int *plock_depth) /************************************************************** Intialize a smb_passwd struct *************************************************************/ + static void pdb_init_smb(struct smb_passwd *user) { - if (user == NULL) + if (user == NULL) return; - ZERO_STRUCTP (user); + ZERO_STRUCTP (user); - user->pass_last_set_time = (time_t)-1; + user->pass_last_set_time = get_time_t_max(); } - - /*************************************************************** Internal fn to enumerate the smbpasswd list. Returns a void pointer to ensure no modification outside this module. Checks for atomic @@ -1154,22 +1153,21 @@ Error was %s\n", pwd->smb_name, pfile2, strerror(errno))); ********************************************************************/ static BOOL build_smb_pass (struct smb_passwd *smb_pw, SAM_ACCOUNT *sampass) { - if (sampass == NULL) + if (sampass == NULL) return False; - ZERO_STRUCTP(smb_pw); + ZERO_STRUCTP(smb_pw); - smb_pw->smb_userid=pdb_get_uid(sampass); - smb_pw->smb_name=pdb_get_username(sampass); + smb_pw->smb_userid=pdb_get_uid(sampass); + smb_pw->smb_name=pdb_get_username(sampass); smb_pw->smb_passwd=pdb_get_lanman_passwd(sampass); smb_pw->smb_nt_passwd=pdb_get_nt_passwd(sampass); - smb_pw->acct_ctrl=pdb_get_acct_ctrl(sampass); - smb_pw->pass_last_set_time=pdb_get_pass_last_set_time(sampass); - - return True; + smb_pw->acct_ctrl=pdb_get_acct_ctrl(sampass); + smb_pw->pass_last_set_time=pdb_get_pass_last_set_time(sampass); + return True; } /********************************************************************* |