You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Jeff Trawick <tr...@gmail.com> on 2014/08/11 13:19:49 UTC

Re: svn commit: r1617201 - /httpd/httpd/trunk/modules/arch/unix/mod_unixd.c

On Mon, Aug 11, 2014 at 1:06 AM, <ta...@apache.org> wrote:

> Author: takashi
> Date: Mon Aug 11 05:06:50 2014
> New Revision: 1617201
>
> URL: http://svn.apache.org/r1617201
> Log:
> geteuid is always successful,
> so remove errno reference.
>
> Modified:
>     httpd/httpd/trunk/modules/arch/unix/mod_unixd.c
>
> Modified: httpd/httpd/trunk/modules/arch/unix/mod_unixd.c
> URL:
> http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/arch/unix/mod_unixd.c?rev=1617201&r1=1617200&r2=1617201&view=diff
>
> ==============================================================================
> --- httpd/httpd/trunk/modules/arch/unix/mod_unixd.c (original)
> +++ httpd/httpd/trunk/modules/arch/unix/mod_unixd.c Mon Aug 11 05:06:50
> 2014
> @@ -150,8 +150,7 @@ AP_DECLARE(int) ap_unixd_setup_child(voi
>
>      if (NULL != ap_unixd_config.chroot_dir) {
>          if (geteuid()) {
> -            rv = errno;
>

rv still needs to get set to something non-zero as part of reporting
failure to the caller; EPERM perhaps, or APR_EGENERAL?



> -            ap_log_error(APLOG_MARK, APLOG_ALERT, errno, NULL,
> APLOGNO(02158)
> +            ap_log_error(APLOG_MARK, APLOG_ALERT, 0, NULL, APLOGNO(02158)
>                           "Cannot chroot when not started as root");
>              return rv;
>          }
>
>
>

Re: svn commit: r1617201 - /httpd/httpd/trunk/modules/arch/unix/mod_unixd.c

Posted by Takashi Sato <ta...@tks.st>.
fixed in r161877.

Re: svn commit: r1617201 - /httpd/httpd/trunk/modules/arch/unix/mod_unixd.c

Posted by Jeff Trawick <tr...@gmail.com>.
On Sat, Aug 16, 2014 at 11:53 AM, Takashi Sato <ta...@tks.st> wrote:

> >> -            rv = errno;
> >
> >
> > rv still needs to get set to something non-zero as part of reporting
> failure
> > to the caller; EPERM perhaps, or APR_EGENERAL?
>
>
> You are right.
> I think EPERM is better. At least chroot(2) and chown(2) returns it.
>

+1


-- 
Born in Roswell... married an alien...
http://emptyhammock.com/

Re: svn commit: r1617201 - /httpd/httpd/trunk/modules/arch/unix/mod_unixd.c

Posted by Takashi Sato <ta...@tks.st>.
>> -            rv = errno;
>
>
> rv still needs to get set to something non-zero as part of reporting failure
> to the caller; EPERM perhaps, or APR_EGENERAL?


You are right.
I think EPERM is better. At least chroot(2) and chown(2) returns it.