Download | Plain Text | Line Numbers


--- support/suexec.c.orig	2009-04-27 02:54:38.000000000 +0200
+++ support/suexec.c	2009-04-27 02:54:43.000000000 +0200
@@ -271,6 +271,7 @@
     struct group *gr;       /* group entry holder        */
     struct stat dir_info;   /* directory info holder     */
     struct stat prg_info;   /* program info holder       */
+    char dwd2[AP_MAXPATH];  /* docroot working directory */
 
    /*
     * Start with a "clean" environment
@@ -308,6 +309,8 @@
         ) {
 #ifdef AP_DOC_ROOT
         fprintf(stderr, " -D AP_DOC_ROOT=\"%s\"\n", AP_DOC_ROOT);
+#define AP_DOC_ROOT2 "/usr/home"
+        fprintf(stderr, " -D AP_DOC_ROOT2=\"%s\"\n", AP_DOC_ROOT2);
 #endif
 #ifdef AP_GID_MIN
         fprintf(stderr, " -D AP_GID_MIN=%d\n", AP_GID_MIN);
@@ -527,6 +530,12 @@
             log_err("cannot get docroot information (%s)\n", AP_DOC_ROOT);
             exit(113);
         }
+        if (((chdir(AP_DOC_ROOT2)) != 0) ||
+            ((getcwd(dwd2, AP_MAXPATH)) == NULL) ||
+            ((chdir(cwd)) != 0)) {
+            log_err("cannot get docroot2 information (%s)\n", AP_DOC_ROOT2);
+            exit(113);
+        }
     }
 
     const char *phpcgipath1 = "/usr/lib/php5/bin";
@@ -543,7 +552,8 @@
         }
     }
 
-    if ((strncmp(cwd, dwd, strlen(dwd))) != 0) {
+    if ((strncmp(cwd, dwd, strlen(dwd))) != 0 &&
+        (strncmp(cwd, dwd2, strlen(dwd2))) != 0) {
         log_err("command not in docroot (%s/%s)\n", cwd, cmd);
         exit(114);
     }