You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2007/10/11 12:30:35 UTC

DO NOT REPLY [Bug 43596] New: - Chroot patch

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


DO NOT REPLY [Bug 43596] - Chroot patch

Posted by bu...@apache.org.
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





------- Additional Comments From wrowe@apache.org  2007-10-13 12:25 -------
Keep in mind http://it.slashdot.org/article.pl?sid=07/09/27/2256235

If you are submitting this as a security necessity, you are already off base.

Not disputing that chroot is not useful, but it should not be viewed as any
security 'feature'.

-- 
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


DO NOT REPLY [Bug 43596] - Chroot patch

Posted by bu...@apache.org.
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





------- Additional Comments From csad3962@uibk.ac.at  2007-10-13 11:37 -------
I wrote a similar patch but it has not been accepted (yet). Maybe people are 
not that concerced about security as I am. I hope the best for your patch.

-- 
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


DO NOT REPLY [Bug 43596] - Chroot patch

Posted by bu...@apache.org.
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





------- Additional Comments From mitko@banksoft-bg.com  2007-10-11 03:31 -------
Created an attachment (id=20957)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=20957&action=view)
httpd-2.2.6-chroot.patch


-- 
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