Changeset 411 for branches/samba-3.3.x/source/passdb
- Timestamp:
- Mar 1, 2010, 3:05:48 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.3.x/source/passdb/login_cache.c
r206 r411 68 68 TDB_DATA databuf; 69 69 LOGIN_CACHE *entry; 70 uint32_t entry_timestamp = 0, bad_password_time = 0; 70 71 71 72 if (!login_cache_init()) … … 92 93 return NULL; 93 94 } 95 ZERO_STRUCTP(entry); 94 96 95 97 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) { 99 102 DEBUG(7, ("No cache entry found\n")); 100 103 SAFE_FREE(entry); … … 102 105 return NULL; 103 106 } 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; 104 111 105 112 SAFE_FREE(databuf.dptr); … … 116 123 TDB_DATA databuf; 117 124 bool ret; 125 uint32_t entry_timestamp; 126 uint32_t bad_password_time = (uint32_t)entry.bad_password_time; 118 127 119 128 if (!login_cache_init()) … … 130 139 } 131 140 132 entry .entry_timestamp =time(NULL);141 entry_timestamp = (uint32_t)time(NULL); 133 142 134 143 databuf.dsize = 135 144 tdb_pack(NULL, 0, SAM_CACHE_FORMAT, 136 entry .entry_timestamp,145 entry_timestamp, 137 146 entry.acct_ctrl, 138 147 entry.bad_password_count, 139 entry.bad_password_time);148 bad_password_time); 140 149 databuf.dptr = SMB_MALLOC_ARRAY(uint8, databuf.dsize); 141 150 if (!databuf.dptr) { … … 145 154 146 155 if (tdb_pack(databuf.dptr, databuf.dsize, SAM_CACHE_FORMAT, 147 entry .entry_timestamp,156 entry_timestamp, 148 157 entry.acct_ctrl, 149 158 entry.bad_password_count, 150 entry.bad_password_time)159 bad_password_time) 151 160 != databuf.dsize) { 152 161 SAFE_FREE(keystr);
Note:
See TracChangeset
for help on using the changeset viewer.