summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@sernet.de>2007-10-21 17:05:34 +0200
committerVolker Lendecke <vl@sernet.de>2007-10-21 19:26:26 +0200
commitd1db41c05971b14b16a4dd27df2c5260fcaa5d7f (patch)
tree2eb02bd925efb181781324f85330ed1c83426366
parent611479fd44433fe8bd26e05eae765bcab032edad (diff)
downloadsamba-d1db41c05971b14b16a4dd27df2c5260fcaa5d7f.tar.gz
samba-d1db41c05971b14b16a4dd27df2c5260fcaa5d7f.tar.bz2
samba-d1db41c05971b14b16a4dd27df2c5260fcaa5d7f.zip
Don't segfault if locking.tdb can't be opened
Thanks to Steve Langasek <vorlon@debian.org> (This used to be commit 67328bd27b1e881a4bcdd5160133afa9a267eaac)
-rw-r--r--source3/utils/status.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source3/utils/status.c b/source3/utils/status.c
index 8bf1de0e61..9a4b3a4835 100644
--- a/source3/utils/status.c
+++ b/source3/utils/status.c
@@ -426,6 +426,19 @@ static int traverse_sessionid(struct db_record *db, void *state)
if ( show_locks ) {
int result;
+ struct db_context *db;
+ db = db_open(NULL, lock_path("locking.tdb"), 0,
+ TDB_DEFAULT, O_RDONLY, 0);
+
+ if (!db) {
+ 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 {
+ TALLOC_FREE(db);
+ }
if (!locking_init(1)) {
d_printf("Can't initialise locking module - exiting\n");