From: William A. Rowe Jr Date: Thu, 6 Jun 2002 03:28:37 +0000 (+0000) Subject: Experimental patch to work around Win32 services defaulting cwd() to X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d55d31c57e14eda7dce31f41d6e546c6448d2755;p=apache Experimental patch to work around Win32 services defaulting cwd() to c:\win\system32 when invoking new service processes. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95541 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/mpm/winnt/mpm_winnt.c b/server/mpm/winnt/mpm_winnt.c index b7f9acd42c..9fa66b5863 100644 --- a/server/mpm/winnt/mpm_winnt.c +++ b/server/mpm/winnt/mpm_winnt.c @@ -2197,7 +2197,15 @@ void winnt_rewrite_args(process_rec *process) * may have extra StartService() command arguments to * add for us. * - * Any other process has a console, so we don't to begin + * The SCM will generally invoke the executable with + * the c:\win\system32 default directory. This is very + * lethal if folks use ServerRoot /foopath on windows + * without a drive letter. Change to the default root + * (path to apache root, above /bin) for safety. + */ + SetCurrentDirectory(def_server_root); + + /* Any other process has a console, so we don't to begin * a Win9x service until the configuration is parsed and * any command line errors are reported. *