diff options
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/gencache/gencache.c | 13 | ||||
-rw-r--r-- | source4/lib/socket/socket.c | 4 |
2 files changed, 7 insertions, 10 deletions
diff --git a/source4/lib/gencache/gencache.c b/source4/lib/gencache/gencache.c index a30f09fefa..08ff55b211 100644 --- a/source4/lib/gencache/gencache.c +++ b/source4/lib/gencache/gencache.c @@ -50,22 +50,23 @@ static struct tdb_wrap *cache; BOOL gencache_init(void) { char* cache_fname = NULL; + TALLOC_CTX *mem_ctx = talloc_autofree_context(); /* skip file open if it's already opened */ if (cache) return True; - asprintf(&cache_fname, "%s/%s", lp_lockdir(), "gencache.tdb"); - if (cache_fname) + cache_fname = lock_path(mem_ctx, "gencache.tdb"); + if (cache_fname != NULL) { DEBUG(5, ("Opening cache file at %s\n", cache_fname)); - else { + } else { DEBUG(0, ("Filename allocation failed.\n")); - return False; + return false; } - cache = tdb_wrap_open(NULL, cache_fname, 0, TDB_DEFAULT, + cache = tdb_wrap_open(mem_ctx, cache_fname, 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0644); - SAFE_FREE(cache_fname); + talloc_free(cache_fname); if (!cache) { DEBUG(5, ("Attempt to open gencache.tdb has failed.\n")); return False; diff --git a/source4/lib/socket/socket.c b/source4/lib/socket/socket.c index a60171ccd1..5e19485ec6 100644 --- a/source4/lib/socket/socket.c +++ b/source4/lib/socket/socket.c @@ -429,10 +429,6 @@ _PUBLIC_ const struct socket_ops *socket_getops_byname(const char *family, enum #if HAVE_IPV6 if (strcmp("ipv6", family) == 0) { - if (lp_parm_bool(-1, "socket", "noipv6", False)) { - DEBUG(3, ("IPv6 support was disabled in smb.conf")); - return NULL; - } return socket_ipv6_ops(type); } #endif |