s3:pdbedit: Use cmdline_messaging_context
authorChristof Schmitt <cs@samba.org>
Mon, 20 Aug 2018 23:08:21 +0000 (16:08 -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/pdbedit.c
source3/utils/wscript_build

index 5c947e2fbde5ba3d62528daa8097dce8ecf7fae0..a2394880c65021965226657dd803bcdab489c27f 100644 (file)
@@ -25,6 +25,7 @@
 #include "../librpc/gen_ndr/samr.h"
 #include "../libcli/security/security.h"
 #include "passdb.h"
+#include "cmdline_contexts.h"
 
 #define BIT_BACKEND    0x00000004
 #define BIT_VERBOSE    0x00000008
@@ -1121,6 +1122,8 @@ int main(int argc, const char **argv)
        if (user_name == NULL)
                user_name = poptGetArg(pc);
 
+       cmdline_messaging_context(get_dyn_CONFIGFILE());
+
        if (!lp_load_global(get_dyn_CONFIGFILE())) {
                fprintf(stderr, "Can't load %s - run testparm to debug it\n", get_dyn_CONFIGFILE());
                exit(1);
index 06a986cada4fb887eecd60b1604665256c3707a6..570c4506beee03f2748fd19fd11fa0cd847a77b7 100644 (file)
@@ -47,6 +47,7 @@ bld.SAMBA3_BINARY('pdbedit',
                  talloc
                  smbconf
                  popt_samba3
+                 cmdline_contexts
                  pdb
                  PASSWD_UTIL''')