s3: remove now unneeded call to cmdline_messaging_context()
authorRalph Boehme <slow@samba.org>
Sat, 4 May 2019 10:12:48 +0000 (12:12 +0200)
committerJeremy Allison <jra@samba.org>
Thu, 24 Oct 2019 09:33:47 +0000 (09:33 +0000)
This was only needed as dbwrap_open() had a bug where it asked for the ctdb
connection before initializing messaging. The previous commit fixed that so we
can now safely remove the calls to cmdline_messaging_context() from all tools
that don't use messaging.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13925

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Oct 24 09:33:47 UTC 2019 on sn-devel-184

source3/lib/popt_common_cmdline.c
source3/utils/dbwrap_tool.c
source3/utils/eventlogadm.c
source3/utils/ntlm_auth.c
source3/utils/pdbedit.c
source3/utils/sharesec.c
source3/utils/smbget.c
source3/utils/smbpasswd.c
source3/utils/testparm.c

index 79e34847f48d2743fab4ce3895c2d01df87a613e..39a787510a32e8155d786bcc34abf85f5a2a5e5a 100644 (file)
@@ -102,15 +102,8 @@ static void popt_common_credentials_callback(poptContext con,
        }
 
        if (reason == POPT_CALLBACK_REASON_POST) {
-               struct messaging_context *msg_ctx = NULL;
                bool ok;
 
-               msg_ctx = cmdline_messaging_context(get_dyn_CONFIGFILE());
-               if (msg_ctx == NULL) {
-                       fprintf(stderr, "Unable to initialize "
-                               "messaging context\n");
-               }
-
                ok = lp_load_client(get_dyn_CONFIGFILE());
                if (!ok) {
                        const char *pname = poptGetInvocationName(con);
index 84ff6f9d3c465c9311154eb0607ff2cf9cc95adc..5d4791473a0ad2dde4d90aed6ba67477f3dc6bba 100644 (file)
@@ -422,8 +422,6 @@ 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 db874dfae8a70d54006b0ac0bb0f235e0e71e71c..2770fffa48ce1467a1e802069406dadc32807146 100644 (file)
@@ -473,9 +473,6 @@ int main( int argc, char *argv[] )
                exit( 1 );
        }
 
-       cmdline_messaging_context(configfile == NULL ?
-                                 get_dyn_CONFIGFILE() : configfile);
-
        if ( configfile == NULL ) {
                lp_load_global(get_dyn_CONFIGFILE());
        } else if (!lp_load_global(configfile)) {
index a10b3ef27f16e84e488ee00372fc25f782a67b48..85862e389e8e9310d4a34a7199e8bf597e01335e 100644 (file)
@@ -2544,8 +2544,6 @@ enum {
 
        poptFreeContext(pc);
 
-       cmdline_messaging_context(get_dyn_CONFIGFILE());
-
        if (!lp_load_global(get_dyn_CONFIGFILE())) {
                d_fprintf(stderr, "ntlm_auth: error opening config file %s. Error was %s\n",
                        get_dyn_CONFIGFILE(), strerror(errno));
index 64ae08d4f0d5b293b4709c56ab380b50de6badbb..b6ee806e190e030193f84faac4db2b5f13c2e54d 100644 (file)
@@ -1128,8 +1128,6 @@ 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 a73af18044515edbdd5a83e1970b3c11c2c44d4d..510505f00327d589c6bd620e0070057c6b7c92ee 100644 (file)
@@ -501,7 +501,6 @@ int main(int argc, const char *argv[])
 
        setlinebuf(stdout);
 
-       cmdline_messaging_context(get_dyn_CONFIGFILE());
        lp_load_with_registry_shares(get_dyn_CONFIGFILE());
 
        /* check for initializing secrets.tdb first */
index 0b1de58ffa39641605b510b5afd1aa5f7e8811d3..68e2217fb565ad0e6be425ea2633a7b2e5dfae70 100644 (file)
@@ -1007,8 +1007,6 @@ int main(int argc, char **argv)
 
        popt_burn_cmdline_password(argc, argv);
 
-       cmdline_messaging_context(get_dyn_CONFIGFILE());
-
        if (smbc_init(get_auth_data, opt.debuglevel) < 0) {
                fprintf(stderr, "Unable to initialize libsmbclient\n");
                ret= 1;
index 8e2b9d7f80fda7ad9d56df5af5058d25766a883b..a6509abe5cbb2b328231bbd21dae1239e892ddfd 100644 (file)
@@ -197,8 +197,6 @@ static int process_options(int argc, char **argv, int local_flags)
                usage();
        }
 
-       cmdline_messaging_context(configfile);
-
        if (!lp_load_global(configfile)) {
                fprintf(stderr, "Can't load %s - run testparm to debug it\n", 
                        configfile);
index efa58a6a417a5b8bd95638f1ca6ac4ea02656947..9ba625da4bf411e6169590d1a67bf849ee684e77 100644 (file)
@@ -742,8 +742,6 @@ static void do_per_share_checks(int s)
                goto done;
        }
 
-       cmdline_messaging_context(config_file);
-
        fprintf(stderr,"Load smb config files from %s\n",config_file);
 
        if (!lp_load_with_registry_shares(config_file)) {