Summary: SELinux prevented httpd (/usr/bin/perl5.10.1) write access to BackupPC. Detailed Description: SELinux prevented httpd write access to BackupPC. httpd scripts are not allowed to write to content without explicit labeling of all files. If BackupPC is writable content. it needs to be labeled httpd_sys_content_rw_t or if all you need is append you can label it httpd_sys_content_ra_t. Please refer to 'man httpd_selinux' for more information on setting up httpd and selinux. Allowing Access: You can alter the file context by executing chcon -R -t httpd_sys_content_rw_t 'BackupPC' You must also change the default file context files on the system in order to preserve them even on a full relabel. "semanage fcontext -a -t httpd_sys_content_rw_t 'BackupPC'" Fix Command: chcon -R -t httpd_sys_content_rw_t 'BackupPC' Additional Information: Source Context unconfined_u:system_r:httpd_t:s0 Target Context system_u:object_r:httpd_sys_content_t:s0 Target Objects BackupPC [ dir ] Source perl5.10.1 Source Path /usr/bin/perl5.10.1 Port <Unknown> Host (removed) Source RPM Packages perl-5.10.1-112.fc13 Target RPM Packages Policy RPM selinux-policy-3.7.19-10.fc13 Selinux Enabled True Policy Type targeted Enforcing Mode Enforcing Plugin Name httpd_write_content Host Name (removed) Platform Linux (removed) 2.6.33.3-85.fc13.x86_64 #1 SMP Thu May 6 18:09:49 UTC 2010 x86_64 x86_64 Alert Count 2 First Seen Sun 16 May 2010 01:36:37 PM CDT Last Seen Sun 16 May 2010 01:36:37 PM CDT Local ID 4350639a-52a1-4c1d-9d37-ffa1368d1779 Line Numbers Raw Audit Messages node=(removed) type=AVC msg=audit(1274034997.532:34306): avc: denied { write } for pid=16903 comm="perl5.10.1" name="BackupPC" dev=dm-0 ino=532127 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:httpd_sys_content_t:s0 tclass=dir node=(removed) type=SYSCALL msg=audit(1274034997.532:34306): arch=c000003e syscall=2 success=no exit=-13 a0=2be3600 a1=241 a2=1b6 a3=3a42d1d770 items=0 ppid=14029 pid=16903 auid=500 uid=48 gid=489 euid=489 suid=489 fsuid=489 egid=489 sgid=489 fsgid=489 tty=(none) ses=1 comm="perl5.10.1" exe="/usr/bin/perl5.10.1" subj=unconfined_u:system_r:httpd_t:s0 key=(null) Hash String generated from httpd_write_content,perl5.10.1,httpd_t,httpd_sys_content_t,dir,write audit2allow suggests: #============= httpd_t ============== #!!!! This avc can be allowed using the boolean 'httpd_unified' allow httpd_t httpd_sys_content_t:dir write;
Not sure of the path to the BackupPC directory. From looking at the policy that BackupPC ships, they expect apache to only write to the /etc/BackupPC/pc directory? Do you think it is trying to write to a different directory? Turning on the httpd_unified boolean will allow apache to write to all its content.
I was trying to change some of the main BackupPC settings through the admin web page. It needed access to /etc/BackupPC/config.pl to write the changes.
chcon -t httpd_sys_content_rw_t /etc/BackupPC/config.pl Should fix
Hmm.. Nogo. It looks like it creates a new file first instead of modifying the existing. Error message below: TextFileWrite: Failed to write /etc/BackupPC//config.pl.new
Try to set the context on the whole directory : chcon -R -t httpd_sys_content_rw_t /etc/BackupPC
As I never try to change main config file from the we interface, I never get these issue. Anyways ; that will prevent writing to the config.pl and HOSTS file ; I'll push a fix soon.
That did the trick.
BackupPC-3.1.0-13.fc12 has been submitted as an update for Fedora 12. http://admin.fedoraproject.org/updates/BackupPC-3.1.0-13.fc12
BackupPC-3.1.0-6.el5 has been submitted as an update for Fedora EPEL 5. http://admin.fedoraproject.org/updates/BackupPC-3.1.0-6.el5
BackupPC-3.1.0-14.fc13 has been submitted as an update for Fedora 13. http://admin.fedoraproject.org/updates/BackupPC-3.1.0-14.fc13
BackupPC-3.1.0-14.fc13 has been pushed to the Fedora 13 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update BackupPC'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/BackupPC-3.1.0-14.fc13
BackupPC-3.1.0-13.fc12 has been pushed to the Fedora 12 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update BackupPC'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/BackupPC-3.1.0-13.fc12
BackupPC-3.1.0-6.el5 has been pushed to the Fedora EPEL 5 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update BackupPC'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/BackupPC-3.1.0-6.el5
BackupPC-3.1.0-13.fc12 has been pushed to the Fedora 12 stable repository. If problems still persist, please make note of it in this bug report.
BackupPC-3.1.0-14.fc13 has been pushed to the Fedora 13 stable repository. If problems still persist, please make note of it in this bug report.
BackupPC-3.1.0-6.el5 has been pushed to the Fedora EPEL 5 stable repository. If problems still persist, please make note of it in this bug report.