Bug 34423 - Permissions for jk_log_lock not being set correctly for APR_USE_FLOCK_SERIALIZE
Summary: Permissions for jk_log_lock not being set correctly for APR_USE_FLOCK_SERIALIZE
Status: RESOLVED FIXED
Alias: None
Product: Tomcat Connectors
Classification: Unclassified
Component: Common (show other bugs)
Version: unspecified
Hardware: PC FreeBSD
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-12 23:23 UTC by Allan Saddi
Modified: 2008-10-05 03:09 UTC (History)
0 users



Attachments
Proposed fix (616 bytes, patch)
2005-04-12 23:26 UTC, Allan Saddi
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Allan Saddi 2005-04-12 23:23:12 UTC
I was trying out mod_jk 1.2.10 with Apache 2.0.53 on FreeBSD when I noticed these errors messages in 
the log:

...
[Tue Apr 12 03:18:00 2005] [crit] (13)Permission denied: mod_jk: could not init JK log lock in child
[Tue Apr 12 03:18:00 2005] [crit] (13)Permission denied: mod_jk: could not init JK log lock in child
[Tue Apr 12 03:18:00 2005] [crit] (13)Permission denied: mod_jk: could not init JK log lock in child
...

Upon further examination, it appeared to be caused by wrong permissions on the lock. (It remained 
owned by, and only readable/writable by root.) It seems unixd_set_global_mutex_perms() was not being 
called when APR_USE_FLOCK_SERIALIZE was set (as it is on FreeBSD).

The fix is fairly simple: change the conditional tests for APR_USE_SYSVSEM_SERIALIZE to also include 
APR_USE_FLOCK_SERIALIZE, i.e. from

  #if APR_USE_SYSVSEM_SERIALIZE

to

  #if APR_USE_SYSVSEM_SERIALIZE || APR_USE_FLOCK_SERIALIZE

Output of httpd -V:

Server version: Apache/2.0.53
Server built:   Feb 16 2005 13:42:04
Server's Module Magic Number: 20020903:9
Architecture:   32-bit
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_FLOCK_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D HTTPD_ROOT="/usr/local"
 -D SUEXEC_BIN="/usr/local/bin/suexec"
 -D DEFAULT_PIDLOG="/var/run/httpd.pid"
 -D DEFAULT_SCOREBOARD="/var/run/apache_runtime_status"
 -D DEFAULT_LOCKFILE="/var/run/accept.lock"
 -D DEFAULT_ERRORLOG="/var/log/httpd-error.log"
 -D AP_TYPES_CONFIG_FILE="etc/apache2/mime.types"
 -D SERVER_CONFIG_FILE="etc/apache2/httpd.conf"
Comment 1 Allan Saddi 2005-04-12 23:26:08 UTC
Created attachment 14695 [details]
Proposed fix

This patch was made against the 1.2.10 distribution, relative to the jk/native
directory.
Comment 2 Mladen Turk 2005-04-13 08:35:43 UTC
Committed, thanks!