From 174100c30997e6ae70492528da998e30c1bfce60 Mon Sep 17 00:00:00 2001 From: Kai Blin Date: Mon, 4 Feb 2008 16:16:59 +0100 Subject: popt: Use SMB_CONF_PATH environment var if no other configfile is set. Now --configfile (or -s) will have precedence, if that's not given SMB_CONF_PATH is checked, otherwise the $(CONFIGDIR)/smb.conf default value is used. Thanks to Michael for his comments. (This used to be commit 92a9c6c56fa90aead3b7f4a07bf4f3973ba23555) --- source3/lib/popt_common.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'source3/lib/popt_common.c') diff --git a/source3/lib/popt_common.c b/source3/lib/popt_common.c index 5a9d39d181..7f7d23fa00 100644 --- a/source3/lib/popt_common.c +++ b/source3/lib/popt_common.c @@ -71,10 +71,19 @@ static void popt_common_callback(poptContext con, } if (reason == POPT_CALLBACK_REASON_POST) { - if (!PrintSambaVersionString) return; - printf( "Version %s\n", SAMBA_VERSION_STRING); - exit(0); + if (PrintSambaVersionString) { + printf( "Version %s\n", SAMBA_VERSION_STRING); + exit(0); + } + + if (is_default_dyn_CONFIGFILE()) { + if(getenv("SMB_CONF_PATH")) { + set_dyn_CONFIGFILE(getenv("SMB_CONF_PATH")); + } + } + + /* Further 'every Samba program must do this' hooks here. */ return; } -- cgit