Skip to content

Commit 5c9c78d

Browse files
committed
* modules/arch/unix/mod_unixd.ci (ap_unixd_setup_child):
Do not test euid=0 before going chroot Nowaday chroot need CAP_SYS_CHROOT capability in its user namespace, and could work without root. Will allow to use chroot with lesser permission. Submitted by: Bastien Roucariès <rouca debian.org> PR: 69767 Github: closes #549 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1927804 13f79535-47bb-0310-9956-ffa450edef68
1 parent 149f6c7 commit 5c9c78d

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

changes-entries/pr69767.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*) mod_unixd: Drop test that effective user ID is zero in
2+
a chroot configuration. PR 69767.
3+
[Bastien Roucaries <rouca debian.org>]

modules/arch/unix/mod_unixd.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,6 @@ AP_DECLARE(int) ap_unixd_setup_child(void)
152152
}
153153

154154
if (NULL != ap_unixd_config.chroot_dir) {
155-
if (geteuid()) {
156-
ap_log_error(APLOG_MARK, APLOG_ALERT, 0, NULL, APLOGNO(02158)
157-
"Cannot chroot when not started as root");
158-
return EPERM;
159-
}
160-
161155
if (chdir(ap_unixd_config.chroot_dir) != 0) {
162156
rv = errno;
163157
ap_log_error(APLOG_MARK, APLOG_ALERT, errno, NULL, APLOGNO(02159)

0 commit comments

Comments
 (0)