]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Follow up r1617201:
authorTakashi Sato <takashi@apache.org>
Tue, 19 Aug 2014 01:27:38 +0000 (01:27 +0000)
committerTakashi Sato <takashi@apache.org>
Tue, 19 Aug 2014 01:27:38 +0000 (01:27 +0000)
Return EPERM if the uid is not root on chroot-ing.

Pointed out by trawick on
<CAKUrXK6EGmG1ZD4+UFZ05yznTe6twOU3n57YeO-Ney-_VV_dCQ@mail.gmail.com>

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1618778 13f79535-47bb-0310-9956-ffa450edef68

modules/arch/unix/mod_unixd.c

index bb056c01c0883a3732fab43fec09fcf74d4bbdf9..09343d368e2286d68c1369f3953336bc5f9dce6d 100644 (file)
@@ -152,7 +152,7 @@ AP_DECLARE(int) ap_unixd_setup_child(void)
         if (geteuid()) {
             ap_log_error(APLOG_MARK, APLOG_ALERT, 0, NULL, APLOGNO(02158)
                          "Cannot chroot when not started as root");
-            return rv;
+            return EPERM;
         }
 
         if (chdir(ap_unixd_config.chroot_dir) != 0) {