httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Trawick" <traw...@gmail.com>
Subject Re: [PROPOSAL] introduce a global define for including unixd.h
Date Sat, 08 Dec 2007 13:02:34 GMT
On Dec 7, 2007 2:43 PM, Guenter Knauf <fuankg@apache.org> wrote:
> Hi,
> I came a couple of times already over the ifdefs to avoid the inclusion of unixd.h;
> also many 3rd party modules have this problem;
> therefore I would like to see a global define somewhere for that, f.e.
> AP(R?)_NEEDS_UNIXD_H or such; can we perhaps introduce that?
> This would in future avoid such platform-ifdefs like this:
> http://svn.apache.org/viewvc?view=rev&revision=522933

Backing up a little, the interesting part that requires that header file is

#if !defined(OS2) && !defined(WIN32) && !defined(BEOS) && !defined(NETWARE)
    if (geteuid() == 0) {
        chown(fsc->limitdbfile, unixd_config.user_id, -1);
        chown(apr_pstrcat(p, fsc->limitdbfile, ".LoCK", NULL),
unixd_config.user_id, -1);
        chown(apr_pstrcat(p, fsc->limitdbfile, ".db", NULL),
unixd_config.user_id, -1);
        chown(apr_pstrcat(p, fsc->limitdbfile, ".dir", NULL),
unixd_config.user_id, -1);
        chown(apr_pstrcat(p, fsc->limitdbfile, ".pag", NULL),
unixd_config.user_id, -1);
    }
#endif

Consider providing a function in core that sets ownership of a file to
the user id of web server child processes when appropriate, and let
the file that implements that function worry about whether or not
unixd.h is needed.  All platforms can implement the function, no-op or
not.

ssl_scache_dbm.c has chown() logic like that above.  I don't know if
there are slight variations which should be accommodated.

Mime
View raw message