wbinfo: use POPT_COMMON_CONFIGFILE
authorStefan Metzmacher <metze@samba.org>
Fri, 14 Dec 2007 18:38:23 +0000 (19:38 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 14 Dec 2007 18:38:23 +0000 (19:38 +0100)
We can't use POPT_COMMON_SAMBA as the -s option is
already used by -s, --sid-to-name=SID.

Also load the config file after processing the cmdline options

metze
(This used to be commit 33cbd6903e8b468a782fb5d6913eb82824d3b347)

source3/nsswitch/wbinfo.c

index 2466af142d7d490bb013b1e8543f8d086d06cced..37ff8a78c72bdde348979cfdacbbf85e3548fcb3 100644 (file)
@@ -1340,6 +1340,7 @@ int main(int argc, char **argv, char **envp)
                        /* "user%password,DOM\\user%password,user@EXAMPLE.COM,EXAMPLE.COM\\user%password" }, */
 #endif
                { "separator", 0, POPT_ARG_NONE, 0, OPT_SEPARATOR, "Get the active winbind separator", NULL },
+               POPT_COMMON_CONFIGFILE
                POPT_COMMON_VERSION
                POPT_TABLEEND
        };
@@ -1347,16 +1348,6 @@ int main(int argc, char **argv, char **envp)
        /* Samba client initialisation */
        load_case_tables();
 
-       if (!lp_load(get_dyn_CONFIGFILE(), True, False, False, True)) {
-               d_fprintf(stderr, "wbinfo: error opening config file %s. Error was %s\n",
-                       get_dyn_CONFIGFILE(), strerror(errno));
-               exit(1);
-       }
-
-       if (!init_names())
-               return 1;
-
-       load_interfaces();
 
        /* Parse options */
 
@@ -1375,6 +1366,17 @@ int main(int argc, char **argv, char **envp)
 
        poptFreeContext(pc);
 
+       if (!lp_load(get_dyn_CONFIGFILE(), True, False, False, True)) {
+               d_fprintf(stderr, "wbinfo: error opening config file %s. Error was %s\n",
+                       get_dyn_CONFIGFILE(), strerror(errno));
+               exit(1);
+       }
+
+       if (!init_names())
+               return 1;
+
+       load_interfaces();
+
        pc = poptGetContext(NULL, argc, (const char **)argv, long_options, 
                            POPT_CONTEXT_KEEP_FIRST);