s3:winbindd: put winbindd_cache.tdb into cache_dir, not lock_dir.
authorMichael Adam <obnox@samba.org>
Thu, 15 Jan 2009 23:31:17 +0000 (00:31 +0100)
committerMichael Adam <obnox@samba.org>
Fri, 16 Jan 2009 00:02:23 +0000 (01:02 +0100)
Michael

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

index 330e7643cdf44323d9d6504d12b047aa5b714dc5..b139ed7400e0bae3d51f3203f8498eb0acfa2d1a 100644 (file)
@@ -867,10 +867,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(lock_path("winbindd_cache.tdb"), 0, TDB_DEFAULT, O_RDWR, 0600);
+       tdb = tdb_open_log(cache_path("winbindd_cache.tdb"), 0, TDB_DEFAULT, O_RDWR, 0600);
        if (!tdb) {
                fprintf(stderr, "Cannot open the tdb %s for writing.\n",
-                       lock_path("winbindd_cache.tdb"));
+                       cache_path("winbindd_cache.tdb"));
                return False;
        }
 
@@ -897,13 +897,13 @@ 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(lock_path("winbindd_cache.tdb"),
+       tdb = tdb_open_log(cache_path("winbindd_cache.tdb"),
                                WINBINDD_CACHE_TDB_DEFAULT_HASH_SIZE,
                                TDB_DEFAULT /* TDB_CLEAR_IF_FIRST */, O_RDWR|O_CREAT, 0600);
 
        if (!tdb) {
                fprintf(stderr, "Cannot open the tdb %s for writing.\n",
-                       lock_path("winbindd_cache.tdb"));
+                       cache_path("winbindd_cache.tdb"));
                return False;
        }
 
index 863852e83742df97eca37891897bd6f92f3f5cc6..a0df81eb6e2645bf15bc9b94f2b9f6a1b3d113b2 100644 (file)
@@ -2537,7 +2537,7 @@ bool init_wcache(void)
                return true;
 
        /* when working offline we must not clear the cache on restart */
-       wcache->tdb = tdb_open_log(lock_path("winbindd_cache.tdb"),
+       wcache->tdb = tdb_open_log(cache_path("winbindd_cache.tdb"),
                                WINBINDD_CACHE_TDB_DEFAULT_HASH_SIZE, 
                                lp_winbind_offline_logon() ? TDB_DEFAULT : (TDB_DEFAULT | TDB_CLEAR_IF_FIRST), 
                                O_RDWR|O_CREAT, 0600);
@@ -2580,9 +2580,9 @@ bool initialize_winbindd_cache(void)
                tdb_close(wcache->tdb);
                wcache->tdb = NULL;
 
-               if (unlink(lock_path("winbindd_cache.tdb")) == -1) {
+               if (unlink(cache_path("winbindd_cache.tdb")) == -1) {
                        DEBUG(0,("initialize_winbindd_cache: unlink %s failed %s ",
-                               lock_path("winbindd_cache.tdb"),
+                               cache_path("winbindd_cache.tdb"),
                                strerror(errno) ));
                        return false;
                }
@@ -2864,7 +2864,7 @@ void wcache_flush_cache(void)
                return;
 
        /* when working offline we must not clear the cache on restart */
-       wcache->tdb = tdb_open_log(lock_path("winbindd_cache.tdb"),
+       wcache->tdb = tdb_open_log(cache_path("winbindd_cache.tdb"),
                                WINBINDD_CACHE_TDB_DEFAULT_HASH_SIZE, 
                                lp_winbind_offline_logon() ? TDB_DEFAULT : (TDB_DEFAULT | TDB_CLEAR_IF_FIRST), 
                                O_RDWR|O_CREAT, 0600);
@@ -3693,7 +3693,7 @@ static void validate_panic(const char *const why)
 int winbindd_validate_cache(void)
 {
        int ret = -1;
-       const char *tdb_path = lock_path("winbindd_cache.tdb");
+       const char *tdb_path = cache_path("winbindd_cache.tdb");
        TDB_CONTEXT *tdb = NULL;
 
        DEBUG(10, ("winbindd_validate_cache: replacing panic function\n"));
@@ -3735,7 +3735,7 @@ done:
 int winbindd_validate_cache_nobackup(void)
 {
        int ret = -1;
-       const char *tdb_path = lock_path("winbindd_cache.tdb");
+       const char *tdb_path = cache_path("winbindd_cache.tdb");
 
        DEBUG(10, ("winbindd_validate_cache: replacing panic function\n"));
        smb_panic_fn = validate_panic;