From ffe42b9015b7bbfeb917930b6a48423344adbe59 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 14 Dec 2007 19:38:23 +0100 Subject: wbinfo: use POPT_COMMON_CONFIGFILE 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 | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'source3/nsswitch') diff --git a/source3/nsswitch/wbinfo.c b/source3/nsswitch/wbinfo.c index 2466af142d..37ff8a78c7 100644 --- a/source3/nsswitch/wbinfo.c +++ b/source3/nsswitch/wbinfo.c @@ -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); -- cgit