summaryrefslogtreecommitdiff
path: root/patches/smbstatus-locking.patch
blob: 5ead59e7757e97c46fd06edfdbc96fe80d3ffd26 (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.28a/source/utils/status.c
===================================================================
--- samba-3.0.28a.orig/source/utils/status.c
+++ samba-3.0.28a/source/utils/status.c
@@ -377,6 +377,16 @@
 			tdb_close(tdb);
 		}
 
+		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);