"timeout = %s", t > time(NULL) ? "valid" :
"expired", keystr, endptr+1, ctime(&t)));
+ if (t <= time(NULL)) {
+
+ /* We're expired, delete the entry */
+ tdb_delete(cache, keybuf);
+
+ SAFE_FREE(databuf.dptr);
+ return False;
+ }
+
if (valstr) {
*valstr = SMB_STRDUP(endptr+1);
if (*valstr == NULL) {
*timeout = t;
}
- return t > time(NULL);
+ return True;
}
if (!gencache_get(key, &value, &timeout)) {
DEBUG(5, ("no entry for %s#%02X found.\n", name, name_type));
- gencache_del(key);
SAFE_FREE(key);
- SAFE_FREE(value);
return False;
} else {
DEBUG(5, ("name %s#%02X found.\n", name, name_type));
if (!gencache_get(key, &value, &timeout)) {
DEBUG(5, ("namecache_status_fetch: no entry for %s found.\n", key));
- gencache_del(key);
SAFE_FREE(key);
- SAFE_FREE(value);
return False;
} else {
DEBUG(5, ("namecache_status_fetch: key %s -> %s\n", key, value ));
if (!gencache_get(key, &value, &timeout)) {
DEBUG(5, ("no entry for trusted domain %s found.\n", name));
SAFE_FREE(key);
- SAFE_FREE(value);
return False;
} else {
SAFE_FREE(key);