[TriLUG] Apache and mod_dav permissions problem

Scott Stancil sstancil at geekrooms.com
Wed Oct 23 17:58:31 EDT 2002


Jon Carnes wrote:

>If you can't trace it down, then as a last resort (or simply as a
>secondary security item) you can write a cron job that sets the rights
>properly for all files in that directory structure:
>  chmod -R 444 /direct/ory/
>
>Good Luck.
>
>On Wed, 2002-10-23 at 13:33, Scott Stancil wrote:
>  
>
>>I have RedHat 7.3 running Apache 1.3.23-14 and mod_dav-1.0.3-5 running 
>>well except for a nagging permissions problem.  When new directories or 
>>files are created within a repository, the permissions seem to have a 
>>umask of 007, despite setting the umask to 002 in /etc/init.d/httpd.
>>
>>Anyone have any suggestions on why/how to fix this problem?
>>
>>Thanks in advance.
>>
>>Scott Stancil
>>sstancil at geekrooms.com
>>
>>
>>
>>    
>>
Jon, I considered cronjobs as an option; however clients tend to want 
instant gratification.  

I posted this earlier as a bcc, but mailman caught it.

--
Just in case someone else has this problem down the line, down and dirty 
fix:

1.  Install the mod_dav source RPM.  I untarred the source, edited and 
tarred it up again.  Ran rpmbuild --bb.  Anyone know the options to run 
the build process without running the prep off the top of your head?

2.  Edit dav_fs_repos.h:

#define DAV_FS_MODE_DIR         (S_IRWXU | S_IRWXG | S_IRWXO)
#define DAV_FS_MODE_FILE        (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | 
S_IROTH)

I added read, write, and execute to the directory's other permissions 
and read to the file's other permissions.  I now seem to be able to 
control the real directory permissions through the use of umask prior to 
starting Apache.  Is there a call that I can change S_IRWXO to something 
like S_IRXO?   The rebuild died when I tried this.

3.  Restart Apache and when I create a new directory, permissions are 
set properly at (775) and files at (664).

Scott Stancil
sstancil at geekrooms.com





More information about the TriLUG mailing list