diff options
-rw-r--r-- | source3/auth/user_util.c | 2 | ||||
-rw-r--r-- | source3/include/proto.h | 3 | ||||
-rw-r--r-- | source3/lib/gencache.c | 3 | ||||
-rw-r--r-- | source3/lib/idmap_cache.c | 8 | ||||
-rw-r--r-- | source3/lib/wins_srv.c | 2 | ||||
-rw-r--r-- | source3/libads/sitename_cache.c | 2 | ||||
-rw-r--r-- | source3/libsmb/conncache.c | 2 | ||||
-rw-r--r-- | source3/libsmb/namecache.c | 4 | ||||
-rw-r--r-- | source3/libsmb/namequery.c | 4 | ||||
-rw-r--r-- | source3/libsmb/trustdom_cache.c | 4 | ||||
-rw-r--r-- | source3/passdb/account_pol.c | 2 | ||||
-rw-r--r-- | source3/rpc_server/spoolss/srv_spoolss_nt.c | 3 | ||||
-rw-r--r-- | source3/torture/torture.c | 8 | ||||
-rw-r--r-- | source3/winbindd/winbindd_cm.c | 2 |
14 files changed, 26 insertions, 23 deletions
diff --git a/source3/auth/user_util.c b/source3/auth/user_util.c index 082c885f7a..b52f1dd5bc 100644 --- a/source3/auth/user_util.c +++ b/source3/auth/user_util.c @@ -96,7 +96,7 @@ static bool fetch_map_from_gencache(TALLOC_CTX *ctx, 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; diff --git a/source3/include/proto.h b/source3/include/proto.h index 5985d23b65..811fe4fd91 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -107,7 +107,8 @@ struct file_id vfs_file_id_from_sbuf(connection_struct *conn, const SMB_STRUCT_S 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), diff --git a/source3/lib/gencache.c b/source3/lib/gencache.c index 0d5d9e8815..1ecaad5be5 100644 --- a/source3/lib/gencache.c +++ b/source3/lib/gencache.c @@ -705,7 +705,8 @@ static int stabilize_fn(struct tdb_context *tdb, TDB_DATA key, TDB_DATA val, * @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; diff --git a/source3/lib/idmap_cache.c b/source3/lib/idmap_cache.c index edf37a8496..627ced30b3 100644 --- a/source3/lib/idmap_cache.c +++ b/source3/lib/idmap_cache.c @@ -48,7 +48,7 @@ bool idmap_cache_find_sid2unixid(const struct dom_sid *sid, struct unixid *id, if (key == NULL) { return false; } - ret = gencache_get(key, &value, &timeout); + ret = gencache_get(key, NULL, &value, &timeout); if (!ret) { goto done; } @@ -209,7 +209,7 @@ bool idmap_cache_find_uid2sid(uid_t uid, struct dom_sid *sid, bool *expired) 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; @@ -246,7 +246,7 @@ bool idmap_cache_find_gid2sid(gid_t gid, struct dom_sid *sid, bool *expired) 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; @@ -431,7 +431,7 @@ static bool idmap_cache_del_xid(char t, int xid) 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; diff --git a/source3/lib/wins_srv.c b/source3/lib/wins_srv.c index fb5587f9ba..6f7d5b3b0c 100644 --- a/source3/lib/wins_srv.c +++ b/source3/lib/wins_srv.c @@ -101,7 +101,7 @@ bool wins_srv_is_dead(struct in_addr wins_ip, struct in_addr src_ip) /* 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), diff --git a/source3/libads/sitename_cache.c b/source3/libads/sitename_cache.c index cb1bae5239..b0c4423106 100644 --- a/source3/libads/sitename_cache.c +++ b/source3/libads/sitename_cache.c @@ -95,7 +95,7 @@ char *sitename_fetch(const char *realm) 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", diff --git a/source3/libsmb/conncache.c b/source3/libsmb/conncache.c index 66353188d2..dfc2f471ac 100644 --- a/source3/libsmb/conncache.c +++ b/source3/libsmb/conncache.c @@ -143,7 +143,7 @@ NTSTATUS check_negative_conn_cache( const char *domain, const char *server) 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 " diff --git a/source3/libsmb/namecache.c b/source3/libsmb/namecache.c index 8571dfaca5..ebd51fd919 100644 --- a/source3/libsmb/namecache.c +++ b/source3/libsmb/namecache.c @@ -156,7 +156,7 @@ bool namecache_fetch(const char *name, 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; @@ -294,7 +294,7 @@ bool namecache_status_fetch(const char *keyname, 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); diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c index d86c0ed909..15c7cacae5 100644 --- a/source3/libsmb/namequery.c +++ b/source3/libsmb/namequery.c @@ -183,7 +183,7 @@ char *saf_fetch( const char *domain ) return NULL; } - ret = gencache_get( key, &server, &timeout ); + ret = gencache_get( key, NULL, &server, &timeout ); TALLOC_FREE( key ); @@ -199,7 +199,7 @@ char *saf_fetch( const char *domain ) return NULL; } - ret = gencache_get( key, &server, &timeout ); + ret = gencache_get( key, NULL, &server, &timeout ); TALLOC_FREE( key ); diff --git a/source3/libsmb/trustdom_cache.c b/source3/libsmb/trustdom_cache.c index dadc7518fd..81b366a4cc 100644 --- a/source3/libsmb/trustdom_cache.c +++ b/source3/libsmb/trustdom_cache.c @@ -160,7 +160,7 @@ bool trustdom_cache_fetch(const char* name, struct dom_sid* sid) 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; @@ -191,7 +191,7 @@ uint32 trustdom_cache_fetch_timestamp( void ) 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; diff --git a/source3/passdb/account_pol.c b/source3/passdb/account_pol.c index c94df2961a..14ff946b51 100644 --- a/source3/passdb/account_pol.c +++ b/source3/passdb/account_pol.c @@ -446,7 +446,7 @@ bool cache_account_policy_get(enum pdb_policy_type type, uint32_t *value) 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; diff --git a/source3/rpc_server/spoolss/srv_spoolss_nt.c b/source3/rpc_server/spoolss/srv_spoolss_nt.c index a094b4945a..37f11c78ee 100644 --- a/source3/rpc_server/spoolss/srv_spoolss_nt.c +++ b/source3/rpc_server/spoolss/srv_spoolss_nt.c @@ -630,7 +630,8 @@ static WERROR set_printer_hnd_name(TALLOC_CTX *mem_ctx, 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) { diff --git a/source3/torture/torture.c b/source3/torture/torture.c index b18dd99f5c..f2446d1e34 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -8130,12 +8130,12 @@ static bool run_local_gencache(int dummy) 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; } @@ -8159,7 +8159,7 @@ static bool run_local_gencache(int dummy) 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; @@ -8212,7 +8212,7 @@ static bool run_local_gencache(int dummy) __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; } diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c index 4de9166363..0b8308a5e3 100644 --- a/source3/winbindd/winbindd_cm.c +++ b/source3/winbindd/winbindd_cm.c @@ -1512,7 +1512,7 @@ bool fetch_current_dc_from_gencache(TALLOC_CTX *mem_ctx, if (key == NULL) { goto done; } - if (!gencache_get(key, &value, NULL)) { + if (!gencache_get(key, NULL, &value, NULL)) { goto done; } p = strchr(value, ' '); |