From aff48c6c6daabf0668df2c9880be8b4ae180c7fd Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 6 Jun 2002 03:28:37 +0000 Subject: [PATCH] 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 --- server/mpm/winnt/mpm_winnt.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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. * -- 2.50.1