Can't upload attachments to wiki pages or tickets using tracd --daemonize
|Reported by:||Owned by:||Remy Blank|
This bug manifests itself like this:
Trac detected an internal error: OSError: [Errno 13] Permission denied: '/path/to/project/attachments/wiki/Page/file'
when attempting to upload the first attachment to a wiki page or ticket.
It only happens when using tracd, and then only if the —daemonize switch is used. If exactly the same command line is used without —daemonize (and —pidfile) then it works correctly. I have reproduced this with tracd using both HTTP and AJP protocols.
What appears to be happening is that tracd creates a subdirectory of project/attachments/wiki or project/attachments/ticket to hold all the attachments for that wiki page or ticket. However, it creates the subdirectory with permissions 662 (rw-rw—w-) and thereby denies itself access to the contents of the subdirectory (which requires execute permissions).
This can be worked around by manually chmodding the subdirectory, but this is impractical on an ongoing basis since it needs executing for every wiki page or ticket that needs attachments. Note that once this is done, the files tracd creates within the subdirectory also have permission 662.
When tracd is run without —daemonize, the subdirectory permissions are 775, which is OK.
RHEL and CentOS 5.2