Bug 48651 - Permission denied: mod_fcgid: apr_global_mutex_child_init error
Summary: Permission denied: mod_fcgid: apr_global_mutex_child_init error
Status: RESOLVED FIXED
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_fcgid (show other bugs)
Version: 2.0.63
Hardware: PC FreeBSD
: P2 critical (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-01 06:07 UTC by pservit
Modified: 2010-02-01 07:57 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description pservit 2010-02-01 06:07:05 UTC
FreeBSD 7.2-RELEASE-p4 amd64

Latest version of mod_fcgid 2.3.5 fails with this error in httpd-error.log:

[Mon Feb 01 15:55:03 2010] [emerg] (13)Permission denied: mod_fcgid: apr_global_mutex_child_init error

Previous version 2.3.4 works fine.



As I can see, it tries to create mutex in /var/tmp
On FreeBSD this dir has theese permissions:
drwxrwxrwt   6 root    wheel      3.0K Feb  1 15:55 tmp

Version 2.3.4 creates file with "www" owner:
-rw-------  1 www  wheel     0B Feb  1 15:55 tmp.2.CMfelr

But version 2.3.5 creates it with "root" owner:
-rw-------  1 root  wheel     0B Feb  1 16:02 tmp.4.GgLDa9
Comment 1 Jeff Trawick 2010-02-01 06:27:45 UTC
Please try this patch:

Index: modules/fcgid/fcgid_mutex_unix.c
===================================================================
--- modules/fcgid/fcgid_mutex_unix.c	(revision 904780)
+++ modules/fcgid/fcgid_mutex_unix.c	(working copy)
@@ -56,6 +56,10 @@
 
 #include "ap_mpm.h"
 
+#if MODULE_MAGIC_NUMBER_MAJOR < 20051115
+#define AP_NEED_SET_MUTEX_PERMS
+#endif
+
 #if AP_NEED_SET_MUTEX_PERMS
 #include "unixd.h"
 #endif
Comment 2 pservit 2010-02-01 06:55:06 UTC
(In reply to comment #1)
> Please try this patch:
> 
> Index: modules/fcgid/fcgid_mutex_unix.c
> ===================================================================
> --- modules/fcgid/fcgid_mutex_unix.c    (revision 904780)
> +++ modules/fcgid/fcgid_mutex_unix.c    (working copy)
> @@ -56,6 +56,10 @@
> 
>  #include "ap_mpm.h"
> 
> +#if MODULE_MAGIC_NUMBER_MAJOR < 20051115
> +#define AP_NEED_SET_MUTEX_PERMS
> +#endif
> +
>  #if AP_NEED_SET_MUTEX_PERMS
>  #include "unixd.h"
>  #endif

Thank you. It works.

I just change this line in patch to compile:
#define AP_NEED_SET_MUTEX_PERMS 1
Comment 3 Jeff Trawick 2010-02-01 07:21:31 UTC
Thanks for the quick feedback/fix.  Committed as r905302.
Comment 4 pservit 2010-02-01 07:49:26 UTC
(In reply to comment #3)
> Thanks for the quick feedback/fix.  Committed as r905302.

Will you release new version of mod_fcgid soon ?
I want send PR to update freebsd port to latest version.
Comment 5 Jeff Trawick 2010-02-01 07:57:44 UTC
I'm thinking about rolling 2.3.6 at the end of this week, for potential release sometime next week; that will give us a little more time to get feedback from early adopters without delaying the regression fix too much.

Unfortunately it is always hard to predict when a release will be finalized.  If I were you I'd patch it for now.