In smbstatus, mark locking.tdb and sessionid.tdb as CLEAR_IF_FIRST
authorVolker Lendecke <vl@samba.org>
Mon, 17 Mar 2008 13:45:59 +0000 (14:45 +0100)
committerVolker Lendecke <vl@samba.org>
Mon, 17 Mar 2008 13:56:45 +0000 (14:56 +0100)
This is needed to inform ctdb that it's not a persistent database, with the
O_RDONLY the tdb backend ignores this.

Merge from 491f902098d33f in 3-0-ctdb

source/utils/status.c

index a42c2a11e096ec09381a688d03a28fadf1e4653f..ffa3fbd17f9741b742602db465cbeefaec005cbc 100644 (file)
@@ -386,7 +386,7 @@ static int traverse_sessionid(struct db_record *db, void *state)
        if ( show_processes ) {
                struct db_context *db;
                db = db_open(NULL, lock_path("sessionid.tdb"), 0,
-                            TDB_DEFAULT, O_RDWR, 0644);
+                            TDB_CLEAR_IF_FIRST, O_RDONLY, 0644);
                if (!db) {
                        d_printf("sessionid.tdb not initialised\n");
                } else {
@@ -428,7 +428,7 @@ static int traverse_sessionid(struct db_record *db, void *state)
                int result;
                struct db_context *db;
                db = db_open(NULL, lock_path("locking.tdb"), 0,
-                            TDB_DEFAULT, O_RDONLY, 0);
+                            TDB_CLEAR_IF_FIRST, O_RDONLY, 0);
 
                if (!db) {
                        d_printf("%s not initialised\n",