You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Gregory (Grisha) Trubetskoy" <gr...@ispol.com> on 2003/08/18 21:33:46 UTC

Permissions on global mutex

This is probably true for any os on which APR favors file locking for
global mutexes, in my case it's FreeBSD.

When a global mutex is created with apr_global_mutex_create(), it creates
a file owned by root/wheel whose perms are 600. After the server changes
uid/gid, it no longer has permissions to the file, and the
apr_global_mutex_child_init() will fail with "permission denied".

The only similar use of mutexes I could find as an example was in
mod_rewrite.c, but alas, it suffers from the same problem (which is a bug
AFAICT - try using RewriteLock directive on FreeBSD - if I'm not missing
something, you'll get "Configuration Failed" message in the log and the
server won't start).

I guess my question is - is there some function to set permission on a
file to that specified by User/Group, or is that an "excercise left to the
reader"? I found unixd_set_global_mutex_perms(), but that's SysV
specific....

Any advice/pointers is highly appreciated!

Grisha