Changeset 733 for branches/samba-3.5.x/source3/passdb
- Timestamp:
- Nov 12, 2012, 5:09:31 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.5.x/source3/passdb/pdb_get_set.c
r414 r733 38 38 39 39 /********************************************************************* 40 Test if a change time is a max value. Copes with old and new values 41 of max. 42 ********************************************************************/ 43 44 bool pdb_is_password_change_time_max(time_t test_time) 45 { 46 if (test_time == get_time_t_max()) { 47 return true; 48 } 49 #if (defined(SIZEOF_TIME_T) && (SIZEOF_TIME_T == 8)) 50 if (test_time == 0x7FFFFFFFFFFFFFFFLL) { 51 return true; 52 } 53 #endif 54 if (test_time == 0x7FFFFFFF) { 55 return true; 56 } 57 return false; 58 } 59 60 /********************************************************************* 61 Return an unchanging version of max password change time - 0x7FFFFFFF. 62 ********************************************************************/ 63 64 time_t pdb_password_change_time_max(void) 65 { 66 return 0x7FFFFFFF; 67 } 68 69 /********************************************************************* 40 70 Collection of get...() functions for struct samu. 41 71 ********************************************************************/ … … 85 115 to indicate that the user cannot change their password. jmcd 86 116 */ 87 if ( sampass->pass_can_change_time == get_time_t_max() &&117 if (pdb_is_password_change_time_max(sampass->pass_can_change_time) && 88 118 pdb_get_init_flags(sampass, PDB_CANCHANGETIME) == PDB_CHANGED) 89 119 return sampass->pass_can_change_time; … … 111 141 112 142 if (sampass->acct_ctrl & ACB_PWNOEXP) 113 return get_time_t_max();143 return pdb_password_change_time_max(); 114 144 115 145 if (!pdb_get_account_policy(PDB_POLICY_MAX_PASSWORD_AGE, &expire) 116 146 || expire == (uint32)-1 || expire == 0) 117 return get_time_t_max();147 return pdb_password_change_time_max(); 118 148 119 149 return sampass->pass_last_set_time + expire; … … 122 152 bool pdb_get_pass_can_change(const struct samu *sampass) 123 153 { 124 if ( sampass->pass_can_change_time == get_time_t_max() &&154 if (pdb_is_password_change_time_max(sampass->pass_can_change_time) && 125 155 sampass->pass_last_set_time != 0) 126 156 return False; … … 1002 1032 { 1003 1033 return pdb_set_pass_can_change_time(sampass, 1004 canchange ? 0 : get_time_t_max(),1034 canchange ? 0 : pdb_password_change_time_max(), 1005 1035 PDB_CHANGED); 1006 1036 }
Note:
See TracChangeset
for help on using the changeset viewer.