Merge debian fix for smbstatus locking error message.
authorJeremy Allison <jra@samba.org>
Thu, 13 Dec 2007 02:17:34 +0000 (18:17 -0800)
committerJeremy Allison <jra@samba.org>
Thu, 13 Dec 2007 02:17:34 +0000 (18:17 -0800)
Already fixed differently for 3.2.
Jeremy.

source/utils/status.c

index df742f73e7935a298c8f5256e2ed51a541c365c0..0dc1253a972bf6d6ea400b78d710a911ee5aa83e 100644 (file)
@@ -367,6 +367,16 @@ static int traverse_sessionid(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf, vo
        if ( show_locks ) {
                int ret;
 
+               tdb = tdb_open_log(lock_path("locking.tdb"), 0, TDB_DEFAULT, O_RDONLY, 0);
+
+               if (!tdb) {
+                       d_printf("%s not initialised\n", lock_path("locking.tdb"));
+                       d_printf("This is normal if an SMB client has never connected to your server.\n");
+                       exit(0);
+               } else {
+                       tdb_close(tdb);
+               }
+
                if (!locking_init(1)) {
                        d_printf("Can't initialise locking module - exiting\n");
                        exit(1);