if (key == NULL) {
return false;
}
- found = gencache_get(key, &value, NULL);
+ found = gencache_get(key, NULL, &value, NULL);
TALLOC_FREE(key);
if (!found) {
return false;
bool gencache_set(const char *keystr, const char *value, time_t timeout);
bool gencache_del(const char *keystr);
-bool gencache_get(const char *keystr, char **valstr, time_t *timeout);
+bool gencache_get(const char *keystr, TALLOC_CTX *mem_ctx, char **value,
+ time_t *ptimeout);
bool gencache_parse(const char *keystr,
void (*parser)(time_t timeout, DATA_BLOB blob,
void *private_data),
* @retval False for failure
**/
-bool gencache_get(const char *keystr, char **value, time_t *ptimeout)
+bool gencache_get(const char *keystr, TALLOC_CTX *mem_ctx, char **value,
+ time_t *ptimeout)
{
DATA_BLOB blob;
bool ret = False;
if (key == NULL) {
return false;
}
- ret = gencache_get(key, &value, &timeout);
+ ret = gencache_get(key, NULL, &value, &timeout);
if (!ret) {
goto done;
}
if (key == NULL) {
return false;
}
- ret = gencache_get(key, &value, &timeout);
+ ret = gencache_get(key, NULL, &value, &timeout);
TALLOC_FREE(key);
if (!ret) {
return false;
if (key == NULL) {
return false;
}
- ret = gencache_get(key, &value, &timeout);
+ ret = gencache_get(key, NULL, &value, &timeout);
TALLOC_FREE(key);
if (!ret) {
return false;
time_t timeout;
bool ret = true;
- if (!gencache_get(key, &sid_str, &timeout)) {
+ if (!gencache_get(key, NULL, &sid_str, &timeout)) {
DEBUG(3, ("no entry: %s\n", key));
ret = false;
goto done;
/* If the key exists then the WINS server has been marked as dead */
- result = gencache_get(keystr, NULL, NULL);
+ result = gencache_get(keystr, NULL, NULL, NULL);
SAFE_FREE(keystr);
DEBUG(4, ("wins_srv_is_dead: %s is %s\n", inet_ntoa(wins_ip),
key = sitename_key(query_realm);
- ret = gencache_get( key, &sitename, &timeout );
+ ret = gencache_get( key, NULL, &sitename, &timeout );
SAFE_FREE(key);
if ( !ret ) {
DEBUG(5,("sitename_fetch: No stored sitename for %s\n",
if (key == NULL)
goto done;
- if (gencache_get(key, &value, NULL))
+ if (gencache_get(key, NULL, &value, NULL))
result = negative_conn_cache_valuedecode(value);
done:
DEBUG(9,("check_negative_conn_cache returning result %d for domain %s "
return False;
}
- if (!gencache_get(key, &value, &timeout)) {
+ if (!gencache_get(key, NULL, &value, &timeout)) {
DEBUG(5, ("no entry for %s#%02X found.\n", name, name_type));
SAFE_FREE(key);
return False;
if (!key)
return False;
- if (!gencache_get(key, &value, &timeout)) {
+ if (!gencache_get(key, NULL, &value, &timeout)) {
DEBUG(5, ("namecache_status_fetch: no entry for %s found.\n",
key));
SAFE_FREE(key);
return NULL;
}
- ret = gencache_get( key, &server, &timeout );
+ ret = gencache_get( key, NULL, &server, &timeout );
TALLOC_FREE( key );
return NULL;
}
- ret = gencache_get( key, &server, &timeout );
+ ret = gencache_get( key, NULL, &server, &timeout );
TALLOC_FREE( key );
if (!key)
return False;
- if (!gencache_get(key, &value, &timeout)) {
+ if (!gencache_get(key, NULL, &value, &timeout)) {
DEBUG(5, ("no entry for trusted domain %s found.\n", name));
SAFE_FREE(key);
return False;
time_t timeout;
uint32 timestamp;
- if (!gencache_get(TDOMTSKEY, &value, &timeout)) {
+ if (!gencache_get(TDOMTSKEY, NULL, &value, &timeout)) {
DEBUG(5, ("no timestamp for trusted domain cache located.\n"));
SAFE_FREE(value);
return 0;
goto done;
}
- if (gencache_get(cache_key, &cache_value, NULL)) {
+ if (gencache_get(cache_key, NULL, &cache_value, NULL)) {
uint32 tmp = strtoul(cache_value, NULL, 10);
*value = tmp;
ret = True;
cache_key = talloc_asprintf(talloc_tos(), "PRINTERNAME/%s",
aprinter);
- if ((cache_key != NULL) && gencache_get(cache_key, &tmp, NULL)) {
+ if ((cache_key != NULL) &&
+ gencache_get(cache_key, NULL, &tmp, NULL)) {
found = (strcmp(tmp, printer_not_found) != 0);
if (!found) {
return False;
}
- if (!gencache_get("foo", NULL, NULL)) {
+ if (!gencache_get("foo", NULL, NULL, NULL)) {
d_printf("%s: gencache_get() failed\n", __location__);
return False;
}
- if (!gencache_get("foo", &val, &tm)) {
+ if (!gencache_get("foo", NULL, &val, &tm)) {
d_printf("%s: gencache_get() failed\n", __location__);
return False;
}
return False;
}
- if (gencache_get("foo", &val, &tm)) {
+ if (gencache_get("foo", NULL, &val, &tm)) {
d_printf("%s: gencache_get() on deleted entry "
"succeeded\n", __location__);
return False;
__location__);
return false;
}
- if (gencache_get("blob", &val, &tm)) {
+ if (gencache_get("blob", NULL, &val, &tm)) {
d_printf("%s: gencache_get succeeded\n", __location__);
return false;
}
if (key == NULL) {
goto done;
}
- if (!gencache_get(key, &value, NULL)) {
+ if (!gencache_get(key, NULL, &value, NULL)) {
goto done;
}
p = strchr(value, ' ');