On Dec 7, 2007 2:43 PM, Guenter Knauf <[EMAIL PROTECTED]> 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.

Reply via email to