httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 43596] New: - Chroot patch
Date Thu, 11 Oct 2007 10:30:35 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43596>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43596

           Summary: Chroot patch
           Product: Apache httpd-2
           Version: 2.2.6
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Core
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: mitko@banksoft-bg.com


This patch adds new configuration directive named "ChrootDir".
For example: ChrootDir /var/www-chroot

Chroot is called before changing to the non-privileged user.
. . . 
   if( NULL != unixd_config.chroot_dir ) {
        if(geteuid()) {
            ap_log_error(APLOG_MARK, APLOG_ALERT,errno,NULL,
            "Cannot chroot when not started as root");
            return -1;
        }
        if( chdir( unixd_config.chroot_dir ) != 0 ) {
            ap_log_error(APLOG_MARK, APLOG_ALERT, errno,NULL,
                  "Can't chdir to %s", unixd_config.chroot_dir);
            return -1;
        }
        if( chroot( unixd_config.chroot_dir ) != 0 ) {
            ap_log_error(APLOG_MARK, APLOG_ALERT, errno,NULL,
                    "Can't chroot to %s", unixd_config.chroot_dir);
            return -1;
        }
        if( chdir( "/" ) != 0 ) {
            ap_log_error(APLOG_MARK, APLOG_ALERT, errno,NULL,
                  "Can't chdir to new root");
            return -1;
        }
    }

. . . 
     setuid(unixd_config.user_id) == -1))
. . . 

I use this patch from version 2.0.50 to 2.2.6 and have no problems.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message