Ignore:
Timestamp:
Mar 1, 2010, 3:05:48 PM (15 years ago)
Author:
Herwig Bauernfeind
Message:

Update Samba 3.3.x to 3.3.11

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.3.x/source/passdb/login_cache.c

    r206 r411  
    6868        TDB_DATA databuf;
    6969        LOGIN_CACHE *entry;
     70        uint32_t entry_timestamp = 0, bad_password_time = 0;
    7071
    7172        if (!login_cache_init())
     
    9293                return NULL;
    9394        }
     95        ZERO_STRUCTP(entry);
    9496
    9597        if (tdb_unpack (databuf.dptr, databuf.dsize, SAM_CACHE_FORMAT,
    96                         &entry->entry_timestamp, &entry->acct_ctrl,
    97                         &entry->bad_password_count,
    98                         &entry->bad_password_time) == -1) {
     98                        &entry_timestamp,
     99                        &entry->acct_ctrl,
     100                        &entry->bad_password_count,
     101                        &bad_password_time) == -1) {
    99102                DEBUG(7, ("No cache entry found\n"));
    100103                SAFE_FREE(entry);
     
    102105                return NULL;
    103106        }
     107
     108        /* Deal with possible 64-bit time_t. */
     109        entry->entry_timestamp = (time_t)entry_timestamp;
     110        entry->bad_password_time = (time_t)bad_password_time;
    104111
    105112        SAFE_FREE(databuf.dptr);
     
    116123        TDB_DATA databuf;
    117124        bool ret;
     125        uint32_t entry_timestamp;
     126        uint32_t bad_password_time = (uint32_t)entry.bad_password_time;
    118127
    119128        if (!login_cache_init())
     
    130139        }
    131140
    132         entry.entry_timestamp = time(NULL);
     141        entry_timestamp = (uint32_t)time(NULL);
    133142
    134143        databuf.dsize =
    135144                tdb_pack(NULL, 0, SAM_CACHE_FORMAT,
    136                          entry.entry_timestamp,
     145                         entry_timestamp,
    137146                         entry.acct_ctrl,
    138147                         entry.bad_password_count,
    139                          entry.bad_password_time);
     148                         bad_password_time);
    140149        databuf.dptr = SMB_MALLOC_ARRAY(uint8, databuf.dsize);
    141150        if (!databuf.dptr) {
     
    145154                         
    146155        if (tdb_pack(databuf.dptr, databuf.dsize, SAM_CACHE_FORMAT,
    147                          entry.entry_timestamp,
     156                         entry_timestamp,
    148157                         entry.acct_ctrl,
    149158                         entry.bad_password_count,
    150                          entry.bad_password_time)
     159                         bad_password_time)
    151160            != databuf.dsize) {
    152161                SAFE_FREE(keystr);
Note: See TracChangeset for help on using the changeset viewer.