s3:dbwrap_tool: Use cmdline_messaging_context
authorChristof Schmitt <cs@samba.org>
Tue, 21 Aug 2018 19:34:34 +0000 (12:34 -0700)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 7 Sep 2018 15:26:16 +0000 (17:26 +0200)
Initialize the messaging context through cmdline_messaging_context to
allow access to config in clustered Samba.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13465

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/utils/dbwrap_tool.c
source3/utils/wscript_build

index 9c27fdc194691df559bde1685f6fb65db586f442..2808a5d68bfe5754fb1fa2f4683792c7228633a8 100644 (file)
@@ -27,6 +27,7 @@
 #include "dbwrap/dbwrap_open.h"
 #include "messages.h"
 #include "util_tdb.h"
+#include "cmdline_contexts.h"
 
 enum dbwrap_op { OP_FETCH, OP_STORE, OP_DELETE, OP_ERASE, OP_LISTKEYS,
                 OP_EXISTS };
@@ -421,6 +422,8 @@ int main(int argc, const char **argv)
                while (extra_argv[extra_argc]) extra_argc++;
        }
 
+       cmdline_messaging_context(get_dyn_CONFIGFILE());
+
        lp_load_global(get_dyn_CONFIGFILE());
 
        if ((extra_argc < 2) || (extra_argc > 5)) {
index eabebcf3d52edef8a9e196a248500083b02e3d0c..11bd2015c3a37082410e259f687c2a2069fdc501 100644 (file)
@@ -136,7 +136,9 @@ bld.SAMBA3_BINARY('dbwrap_tool',
                  source='dbwrap_tool.c',
                  deps='''
                  talloc
-                 popt_samba3''')
+                 popt_samba3
+                 cmdline_contexts
+                 ''')
 
 bld.SAMBA3_BINARY('dbwrap_torture',
                  source='dbwrap_torture.c',