diff options
author | Kai Blin <kai@samba.org> | 2008-02-04 16:16:59 +0100 |
---|---|---|
committer | Kai Blin <kai@samba.org> | 2008-02-04 17:41:23 +0100 |
commit | 174100c30997e6ae70492528da998e30c1bfce60 (patch) | |
tree | 3683845c1fb615aca269b528ef87f86cbd9ebe92 /source3/lib/popt_common.c | |
parent | 555941383348f0f740ac169da7b3325f225e9261 (diff) | |
download | samba-174100c30997e6ae70492528da998e30c1bfce60.tar.gz samba-174100c30997e6ae70492528da998e30c1bfce60.tar.bz2 samba-174100c30997e6ae70492528da998e30c1bfce60.zip |
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)
Diffstat (limited to 'source3/lib/popt_common.c')
-rw-r--r-- | source3/lib/popt_common.c | 15 |
1 files changed, 12 insertions, 3 deletions
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; } |