]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Finish commit 8745c70d by Michael Adam.
authorJeremy Allison <jra@samba.org>
Wed, 14 Sep 2011 21:07:29 +0000 (14:07 -0700)
committerJeremy Allison <jra@samba.org>
Wed, 14 Sep 2011 22:43:04 +0000 (00:43 +0200)
If you're going to move winbindd_cache.tdb to the state_path, do it *everywhere*.

Found by Ira Cooper <ira@wakeful.net>.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Sep 15 00:43:04 CEST 2011 on sn-devel-104

source3/utils/smbcontrol.c
source3/winbindd/winbindd_cache.c

index 246c3aa9b83d7736d5539d587bd8ba13d4f40a08..97161a09bc96f23352ee357cc10ea105072b51a7 100644 (file)
@@ -954,10 +954,10 @@ static bool do_winbind_online(struct messaging_context *msg_ctx,
        /* Remove the entry in the winbindd_cache tdb to tell a later
           starting winbindd that we're online. */
 
-       tdb = tdb_open_log(cache_path("winbindd_cache.tdb"), 0, TDB_DEFAULT, O_RDWR, 0600);
+       tdb = tdb_open_log(state_path("winbindd_cache.tdb"), 0, TDB_DEFAULT, O_RDWR, 0600);
        if (!tdb) {
                fprintf(stderr, "Cannot open the tdb %s for writing.\n",
-                       cache_path("winbindd_cache.tdb"));
+                       state_path("winbindd_cache.tdb"));
                return False;
        }
 
@@ -984,14 +984,14 @@ static bool do_winbind_offline(struct messaging_context *msg_ctx,
           starting winbindd that we're offline. We may actually create
           it here... */
 
-       tdb = tdb_open_log(cache_path("winbindd_cache.tdb"),
+       tdb = tdb_open_log(state_path("winbindd_cache.tdb"),
                                WINBINDD_CACHE_TDB_DEFAULT_HASH_SIZE,
                                TDB_DEFAULT|TDB_INCOMPATIBLE_HASH /* TDB_CLEAR_IF_FIRST */,
                                O_RDWR|O_CREAT, 0600);
 
        if (!tdb) {
                fprintf(stderr, "Cannot open the tdb %s for writing.\n",
-                       cache_path("winbindd_cache.tdb"));
+                       state_path("winbindd_cache.tdb"));
                return False;
        }
 
index b52fe7742993a10834d640d4269938be10ba412c..2bb4df9736b55c0a0c430ba5b21f0ea77e4c3946 100644 (file)
@@ -3150,9 +3150,9 @@ bool initialize_winbindd_cache(void)
                tdb_close(wcache->tdb);
                wcache->tdb = NULL;
 
-               if (unlink(cache_path("winbindd_cache.tdb")) == -1) {
+               if (unlink(state_path("winbindd_cache.tdb")) == -1) {
                        DEBUG(0,("initialize_winbindd_cache: unlink %s failed %s ",
-                               cache_path("winbindd_cache.tdb"),
+                               state_path("winbindd_cache.tdb"),
                                strerror(errno) ));
                        return false;
                }
@@ -3279,7 +3279,7 @@ void wcache_flush_cache(void)
        }
 
        /* when working offline we must not clear the cache on restart */
-       wcache->tdb = tdb_open_log(cache_path("winbindd_cache.tdb"),
+       wcache->tdb = tdb_open_log(state_path("winbindd_cache.tdb"),
                                WINBINDD_CACHE_TDB_DEFAULT_HASH_SIZE, 
                                TDB_INCOMPATIBLE_HASH |
                                (lp_winbind_offline_logon() ? TDB_DEFAULT : (TDB_DEFAULT | TDB_CLEAR_IF_FIRST)),
@@ -4093,7 +4093,7 @@ static void validate_panic(const char *const why)
 int winbindd_validate_cache(void)
 {
        int ret = -1;
-       const char *tdb_path = cache_path("winbindd_cache.tdb");
+       const char *tdb_path = state_path("winbindd_cache.tdb");
        TDB_CONTEXT *tdb = NULL;
 
        DEBUG(10, ("winbindd_validate_cache: replacing panic function\n"));
@@ -4136,7 +4136,7 @@ done:
 int winbindd_validate_cache_nobackup(void)
 {
        int ret = -1;
-       const char *tdb_path = cache_path("winbindd_cache.tdb");
+       const char *tdb_path = state_path("winbindd_cache.tdb");
 
        DEBUG(10, ("winbindd_validate_cache: replacing panic function\n"));
        smb_panic_fn = validate_panic;