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
--- /dev/null
+ *) mod_unixd: Drop test that effective user ID is zero in
+ a chroot configuration. PR 69767.
+ [Bastien Roucaries <rouca debian.org>]
}
if (NULL != ap_unixd_config.chroot_dir) {
- if (geteuid()) {
- ap_log_error(APLOG_MARK, APLOG_ALERT, 0, NULL, APLOGNO(02158)
- "Cannot chroot when not started as root");
- return EPERM;
- }
-
if (chdir(ap_unixd_config.chroot_dir) != 0) {
rv = errno;
ap_log_error(APLOG_MARK, APLOG_ALERT, errno, NULL, APLOGNO(02159)