I get this after an upgrade from F8 to F10: type=1400 audit(1232838174.113:37): avc: denied { write } for pid=1740 comm="httpd" name="userdb.dat" dev=dm-0 ino=1704493 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:httpd_sys_content_t:s0 tclass=file The problem is that httpd is not allowed to update Gallery's user database anymore. I cannot find any boolean that gives httpd the right to write to its content files.
After I set selinux to permissive, I got a whole bunch of other accesses, so I need a general "write enable" switch for httpd on httpd_sys_content_t: type=1400 audit(1232838568.940:47): avc: denied { write } for pid=1738 comm="httpd" name="userdb.dat" dev=dm-0 ino=1704493 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:httpd_sys_content_t:s0 tclass=file type=1400 audit(1232838569.033:48): avc: denied { create } for pid=1738 comm="httpd" name="photos.dat.0" scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:httpd_sys_content_t:s0 tclass=file type=1400 audit(1232838569.035:49): avc: denied { rename } for pid=1738 comm="httpd" name="photos.dat" dev=dm-0 ino=1716710 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:httpd_sys_content_t:s0 tclass=file type=1400 audit(1232838569.035:50): avc: denied { unlink } for pid=1738 comm="httpd" name="photos.dat.bak" dev=dm-0 ino=1716613 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:httpd_sys_content_t:s0 tclass=file type=1400 audit(1232838713.902:52): avc: denied { append } for pid=1739 comm="httpd" name="photos.dat.lock" dev=dm-0 ino=1907011 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:httpd_sys_content_t:s0 tclass=file
You can change the directory to httpd_sys_content_rw_t using semanage. Or you can turn on the httpd_unified boolean. What is the path to the directory?
setsebool -P httpd_unified=1
(In reply to comment #2) > You can change the directory to httpd_sys_content_rw_t using semanage. Or you > can turn on the httpd_unified boolean. > Thanks. I noticed now that this was properly documented in httpd_selinux(8), which I for some reason didn't think to look for. :/ > What is the path to the directory? /var/www/gallery/albums/ Anyhoo, a broad chcon to the mutable portions of the site got things working beautifully. Thanks again. :)
Miroslav, Add /var/www/gallery/albums(/.*)? gen_context(system_u:object_r:httpd_sys_content_rw_t,s0) To apache.fc for F10 and F9, please Pierre, you should use semanage to make sure your changes are permanent. semanage fcontext -a -t httpd_sys_content_rw_t '/var/www/gallery/albums(/.*)?'
(In reply to comment #5) > Miroslav, > > Add > /var/www/gallery/albums(/.*)? > gen_context(system_u:object_r:httpd_sys_content_rw_t,s0) > > To apache.fc for F10 and F9, please > I'm not sure this is a standard location, so I can't say I'd advocate this based on just my setup. > Pierre, you should use semanage to make sure your changes are permanent. > > semanage fcontext -a -t httpd_sys_content_rw_t > '/var/www/gallery/albums(/.*)?' Ah thanks. Do the tools read all files in /etc/selinux/targeted/contexts/files or just the "well-defined" ones?
It reads all of the files.
Fixed in selinux-policy-3.5.13-41.fc10
Regarding the standard location, at least in the version of gallery that we ship, I belive that should be /srv/gallery2/albums
Actually, I believe that the entire /srv/gallery2 should be set to httpd_sys_content_rw_t AFAIK, the only thing that that directory contain is files that are put there by gallery2. Which is a webb app (php).
This message is a reminder that Fedora 10 is nearing its end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 10. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '10'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 10's end of life. Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 10 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora please change the 'version' of this bug to the applicable version. If you are unable to change the version, please add a comment here and someone will do it for you. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping