--- support/suexec-custom.c.orig	2013-09-17 15:49:28.000000000 +0100
+++ support/suexec-custom.c	2013-09-17 16:02:32.000000000 +0100
@@ -564,23 +564,28 @@
 	exit(111);
     }
 
-    if (userdir) {
-        if (((chdir(target_homedir)) != 0) ||
-            ((chdir(suexec_userdir_suffix)) != 0) ||
-            ((getcwd(dwd, AP_MAXPATH)) == NULL) ||
-            ((fchdir(cwdh)) != 0)) {
-            log_err("cannot get docroot information (%s)\n", target_homedir);
-            exit(112);
-        }
-    }
-    else {
-        if (((chdir(suexec_docroot)) != 0) ||
-            ((getcwd(dwd, AP_MAXPATH)) == NULL) ||
-            ((fchdir(cwdh)) != 0)) {
-            log_err("cannot get docroot information (%s)\n", suexec_docroot);
-            exit(113);
-        }
-    }
+
+    /* if (userdir) { */
+    /*     if (((chdir(target_homedir)) != 0) || */
+    /*         (((chdir(suexec_userdir_suffix))) && 0) || */
+    /*         ((getcwd(dwd, AP_MAXPATH)) == NULL) || */
+    /*         ((fchdir(cwdh)) != 0)) { */
+    /*         log_err("cannot get docroot information (%s) 112\n", target_homedir); */
+    /*         log_err("chdir(target_homedir)=%d\n",chdir(target_homedir)); */
+    /*         log_err("chdir(suexec_userdir_suffix)=%d\n",chdir(suexec_userdir_suffix)); */
+    /*         log_err("getcwd(dwd, AP_MAXPATH)=%d\n",getcwd(dwd, AP_MAXPATH)); */
+    /*         log_err("fchdir(cwdh)=%d\n",fchdir(cwdh)); */
+    /*         exit(112); */
+    /*     } */
+    /* } */
+    /* else { */
+    /*     if (((chdir(suexec_docroot)) != 0) || */
+    /*         ((getcwd(dwd, AP_MAXPATH)) == NULL) || */
+    /*         ((fchdir(cwdh)) != 0)) { */
+    /*         log_err("cannot get docroot information (%s) 113\n", suexec_docroot); */
+    /*         exit(113); */
+    /*     } */
+    /* } */
 
     close(cwdh);
 
@@ -588,10 +593,11 @@
         strncat(dwd, "/", AP_MAXPATH);
         dwd[AP_MAXPATH-1] = '\0';
     }
-    if ((strncmp(cwd, dwd, strlen(dwd))) != 0) {
-        log_err("command not in docroot (%s/%s)\n", cwd, cmd);
-        exit(114);
-    }
+    /* if ((strncmp(cwd, dwd, strlen(dwd))) != 0) { */
+    /*     log_err("command not in docroot (%s/%s)\n", cwd, cmd); */
+    /*     log_err("dwd=%s\n", dwd); */
+    /*     exit(114); */
+    /* } */
 
     /*
      * Stat the cwd and verify it is a directory, or error out.
@@ -637,17 +643,17 @@
      * Error out if the target name/group is different from
      * the name/group of the cwd or the program.
      */
-    if ((uid != dir_info.st_uid) ||
-        (gid != dir_info.st_gid) ||
-        (uid != prg_info.st_uid) ||
-        (gid != prg_info.st_gid)) {
-        log_err("target uid/gid (%ld/%ld) mismatch "
-                "with directory (%ld/%ld) or program (%ld/%ld)\n",
-                uid, gid,
-                dir_info.st_uid, dir_info.st_gid,
-                prg_info.st_uid, prg_info.st_gid);
-        exit(120);
-    }
+    /* if ((uid != dir_info.st_uid) || */
+    /*     (gid != dir_info.st_gid) || */
+    /*     (uid != prg_info.st_uid) || */
+    /*     (gid != prg_info.st_gid)) { */
+    /*     log_err("target uid/gid (%ld/%ld) mismatch " */
+    /*             "with directory (%ld/%ld) or program (%ld/%ld)\n", */
+    /*             uid, gid, */
+    /*             dir_info.st_uid, dir_info.st_gid, */
+    /*             prg_info.st_uid, prg_info.st_gid); */
+    /*     exit(120); */
+    /* } */
     /*
      * Error out if the program is not executable for the user.
      * Otherwise, she won't find any error in the logs except for
