From: Volker Lendecke Date: Fri, 11 Jul 2008 15:44:25 +0000 (+0200) Subject: Revert "Pass NULL to gencache_get when we are not interested in the timeout value" X-Git-Tag: samba-3.3.0pre1~572 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=114ca8577568cdb5a81d8734f1d1d096f1b36c36;p=thirdparty%2Fsamba.git Revert "Pass NULL to gencache_get when we are not interested in the timeout value" This reverts commit 16062dfc3dcc8f1ca0024a3ae21effb889c7ffc0. --- diff --git a/source/libads/dns.c b/source/libads/dns.c index a8825d32e62..3a9e8496685 100644 --- a/source/libads/dns.c +++ b/source/libads/dns.c @@ -790,6 +790,7 @@ bool sitename_store(const char *realm, const char *sitename) char *sitename_fetch(const char *realm) { char *sitename = NULL; + time_t timeout; bool ret = False; const char *query_realm; char *key; @@ -806,7 +807,7 @@ char *sitename_fetch(const char *realm) key = sitename_key(query_realm); - ret = gencache_get( key, &sitename, NULL ); + ret = gencache_get( key, &sitename, &timeout ); SAFE_FREE(key); if ( !ret ) { DEBUG(5,("sitename_fetch: No stored sitename for %s\n", diff --git a/source/libsmb/namecache.c b/source/libsmb/namecache.c index 1f462ba79ad..ba706e5ee26 100644 --- a/source/libsmb/namecache.c +++ b/source/libsmb/namecache.c @@ -200,6 +200,7 @@ bool namecache_fetch(const char *name, int *num_names) { char *key, *value; + time_t timeout; /* exit now if null pointers were passed as they're required further */ if (!ip_list || !num_names) { @@ -224,7 +225,7 @@ bool namecache_fetch(const char *name, return False; } - if (!gencache_get(key, &value, NULL)) { + if (!gencache_get(key, &value, &timeout)) { DEBUG(5, ("no entry for %s#%02X found.\n", name, name_type)); SAFE_FREE(key); return False; @@ -366,6 +367,7 @@ bool namecache_status_fetch(const char *keyname, { char *key = NULL; char *value = NULL; + time_t timeout; if (!gencache_init()) return False; @@ -375,7 +377,7 @@ bool namecache_status_fetch(const char *keyname, if (!key) return False; - if (!gencache_get(key, &value, NULL)) { + if (!gencache_get(key, &value, &timeout)) { DEBUG(5, ("namecache_status_fetch: no entry for %s found.\n", key)); SAFE_FREE(key); diff --git a/source/libsmb/namequery.c b/source/libsmb/namequery.c index 9b50d209b91..24d7ee1a9c5 100644 --- a/source/libsmb/namequery.c +++ b/source/libsmb/namequery.c @@ -112,6 +112,7 @@ bool saf_delete( const char *domain ) char *saf_fetch( const char *domain ) { char *server = NULL; + time_t timeout; bool ret = False; char *key = NULL; @@ -125,7 +126,7 @@ char *saf_fetch( const char *domain ) key = saf_key( domain ); - ret = gencache_get( key, &server, NULL ); + ret = gencache_get( key, &server, &timeout ); SAFE_FREE( key ); diff --git a/source/libsmb/trustdom_cache.c b/source/libsmb/trustdom_cache.c index 92dde0c6c80..6755de3814b 100644 --- a/source/libsmb/trustdom_cache.c +++ b/source/libsmb/trustdom_cache.c @@ -164,6 +164,7 @@ bool trustdom_cache_store(char* name, char* alt_name, const DOM_SID *sid, bool trustdom_cache_fetch(const char* name, DOM_SID* sid) { char *key = NULL, *value = NULL; + time_t timeout; /* init the cache */ if (!gencache_init()) @@ -178,7 +179,7 @@ bool trustdom_cache_fetch(const char* name, DOM_SID* sid) if (!key) return False; - if (!gencache_get(key, &value, NULL)) { + if (!gencache_get(key, &value, &timeout)) { DEBUG(5, ("no entry for trusted domain %s found.\n", name)); SAFE_FREE(key); return False; @@ -206,13 +207,14 @@ bool trustdom_cache_fetch(const char* name, DOM_SID* sid) uint32 trustdom_cache_fetch_timestamp( void ) { char *value = NULL; + time_t timeout; uint32 timestamp; /* init the cache */ if (!gencache_init()) return False; - if (!gencache_get(TDOMTSKEY, &value, NULL)) { + if (!gencache_get(TDOMTSKEY, &value, &timeout)) { DEBUG(5, ("no timestamp for trusted domain cache located.\n")); SAFE_FREE(value); return 0; diff --git a/source/torture/torture.c b/source/torture/torture.c index 98dd900941d..d8add208f52 100644 --- a/source/torture/torture.c +++ b/source/torture/torture.c @@ -4933,7 +4933,7 @@ static bool run_local_gencache(int dummy) return False; } - if (!gencache_get("foo", &val, NULL)) { + if (!gencache_get("foo", &val, &tm)) { d_printf("%s: gencache_get() failed\n", __location__); return False; } @@ -4957,7 +4957,7 @@ static bool run_local_gencache(int dummy) return False; } - if (gencache_get("foo", &val, NULL)) { + if (gencache_get("foo", &val, &tm)) { d_printf("%s: gencache_get() on deleted entry " "succeeded\n", __location__); return False;