s3/lib:popt_common: Move setup_logging to common callback
authorChristof Schmitt <cs@samba.org>
Mon, 13 Aug 2018 22:07:20 +0000 (15:07 -0700)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 7 Sep 2018 15:26:14 +0000 (17:26 +0200)
The flag is set in the common callback, so be consistent

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/lib/popt_common.c

index cc93a756c3ba529aa5fbaf2443ad3a109d6c039c..454884fbb5c5934ab5549d57adbfe9caa31293a7 100644 (file)
@@ -93,6 +93,10 @@ static void popt_common_callback(poptContext con,
                        }
                }
 
+               if (override_logfile) {
+                       setup_logging(lp_logfile(talloc_tos()), DEBUG_FILE );
+               }
+
                /* Further 'every Samba program must do this' hooks here. */
                return;
        }
@@ -288,10 +292,6 @@ static void popt_common_credentials_callback(poptContext con,
        if (reason == POPT_CALLBACK_REASON_POST) {
                bool ok;
 
-               if (override_logfile) {
-                       setup_logging(lp_logfile(talloc_tos()), DEBUG_FILE );
-               }
-
                ok = lp_load_client(get_dyn_CONFIGFILE());
                if (!ok) {
                        const char *pname = poptGetInvocationName(con);