Ignore:
Timestamp:
Nov 12, 2012, 5:09:31 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server 3.5: update branche to 3.5.13

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.5.x/source3/passdb/pdb_get_set.c

    r414 r733  
    3838
    3939/*********************************************************************
     40 Test if a change time is a max value. Copes with old and new values
     41 of max.
     42 ********************************************************************/
     43
     44bool 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
     64time_t pdb_password_change_time_max(void)
     65{
     66        return 0x7FFFFFFF;
     67}
     68
     69/*********************************************************************
    4070 Collection of get...() functions for struct samu.
    4171 ********************************************************************/
     
    85115           to indicate that the user cannot change their password.  jmcd
    86116        */
    87         if (sampass->pass_can_change_time == get_time_t_max() &&
     117        if (pdb_is_password_change_time_max(sampass->pass_can_change_time) &&
    88118            pdb_get_init_flags(sampass, PDB_CANCHANGETIME) == PDB_CHANGED)
    89119                return sampass->pass_can_change_time;
     
    111141
    112142        if (sampass->acct_ctrl & ACB_PWNOEXP)
    113                 return get_time_t_max();
     143                return pdb_password_change_time_max();
    114144
    115145        if (!pdb_get_account_policy(PDB_POLICY_MAX_PASSWORD_AGE, &expire)
    116146            || expire == (uint32)-1 || expire == 0)
    117                 return get_time_t_max();
     147                return pdb_password_change_time_max();
    118148
    119149        return sampass->pass_last_set_time + expire;
     
    122152bool pdb_get_pass_can_change(const struct samu *sampass)
    123153{
    124         if (sampass->pass_can_change_time == get_time_t_max() &&
     154        if (pdb_is_password_change_time_max(sampass->pass_can_change_time) &&
    125155            sampass->pass_last_set_time != 0)
    126156                return False;
     
    10021032{
    10031033        return pdb_set_pass_can_change_time(sampass,
    1004                                      canchange ? 0 : get_time_t_max(),
     1034                                     canchange ? 0 : pdb_password_change_time_max(),
    10051035                                     PDB_CHANGED);
    10061036}
Note: See TracChangeset for help on using the changeset viewer.