]> granicus.if.org Git - apache/commitdiff
Experimental patch to work around Win32 services defaulting cwd() to
authorWilliam A. Rowe Jr <wrowe@apache.org>
Thu, 6 Jun 2002 03:28:37 +0000 (03:28 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Thu, 6 Jun 2002 03:28:37 +0000 (03:28 +0000)
  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

index b7f9acd42c82448c8e48f711d3d4c762e0f0ca25..9fa66b58637e729c2ed55675c8c0a41875c2d4f1 100644 (file)
@@ -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.
          *