summaryrefslogtreecommitdiff
path: root/patches/smbstatus-locking.patch
blob: 74f8af62c0df8d509e4450b659d492744559e3c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Goal: exit without error from smbstatus when no connections have
     been seen yet

Fixes: #164179. Patch later corrected in #164489

Status wrt upstream: Should be forwarded

Note: 

Index: samba-3.0.25c/source/utils/status.c
===================================================================
--- samba-3.0.25c.orig/source/utils/status.c	2007-08-26 12:07:15.598346358 +0200
+++ samba-3.0.25c/source/utils/status.c	2007-08-26 13:09:04.419603900 +0200
@@ -367,6 +367,16 @@
 	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);