r22622: make it possible to pass the config file via 'SMB_CONF_PATH' envvar
authorStefan Metzmacher <metze@samba.org>
Tue, 1 May 2007 03:25:17 +0000 (03:25 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:51:54 +0000 (14:51 -0500)
very usefull for make testenv!

this makes it also possible to pass a config file to smbscript

metze
(This used to be commit f65fcd764b656ba9953d88dc7b002e4977af5011)

source4/lib/cmdline/popt_common.c
source4/scripting/ejs/smbscript.c

index 1eeb797e6eb94fa3cc4302e810ce700bbb567747..1752f43a849c3066a728468f133e8fcb4272a175 100644 (file)
@@ -69,6 +69,10 @@ static void popt_common_callback(poptContext con,
 
                /* and logging */
                setup_logging(pname, DEBUG_STDOUT);
+
+               if (getenv("SMB_CONF_PATH")) {
+                       lp_set_cmdline("config file", getenv("SMB_CONF_PATH"));
+               }
                return;
        }
 
index 23e2fe2d52cd08a0bf93684d052b47973b8556c4..26f4c0f07053da484123fb3b87bdedcc81839ad4 100644 (file)
@@ -52,6 +52,10 @@ int main(int argc, const char **argv)
 
        fault_setup(argv[0]);
 
+       if (getenv("SMB_CONF_PATH")) {
+               lp_set_cmdline("config file", getenv("SMB_CONF_PATH"));
+       }
+
        ldb_global_init();
 
        gensec_init();