Bug 966323 - SELinux is preventing /usr/bin/perl from 'remove_name' accesses on the directory bugs-journal.
SELinux is preventing /usr/bin/perl from 'remove_name' accesses on the direct...
Status: CLOSED DUPLICATE of bug 966321
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
18
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Miroslav Grepl
Fedora Extras Quality Assurance
abrt_hash:52c1dac019062e2215bfa21dc0e...
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-23 00:17 EDT by Moez Roy
Modified: 2013-05-23 04:20 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-05-23 04:20:24 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Moez Roy 2013-05-23 00:17:57 EDT
Description of problem:
SELinux is preventing /usr/bin/perl from 'remove_name' accesses on the directory bugs-journal.

*****  Plugin httpd_write_content (92.2 confidence) suggests  ****************

If you want to allow perl to have remove_name access on the bugs-journal directory
Then you need to change the label on 'bugs-journal'
Do
# semanage fcontext -a -t httpd_sys_rw_content_t 'bugs-journal'
# restorecon -v 'bugs-journal'

*****  Plugin catchall_boolean (7.83 confidence) suggests  *******************

If you want to unify HTTPD handling of all content files.
Then you must tell SELinux about this by enabling the 'httpd_unified' boolean.
You can read 'httpd_selinux' man page for more details.
Do
setsebool -P httpd_unified 1

*****  Plugin catchall (1.41 confidence) suggests  ***************************

If you believe that perl should be allowed remove_name access on the bugs-journal directory by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# grep buglist.cgi /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:httpd_t:s0
Target Context                unconfined_u:object_r:httpd_sys_content_t:s0
Target Objects                bugs-journal [ dir ]
Source                        buglist.cgi
Source Path                   /usr/bin/perl
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           perl-5.16.3-244.fc18.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.11.1-96.fc18.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 3.9.2-200.fc18.x86_64 #1 SMP Mon
                              May 13 13:59:47 UTC 2013 x86_64 x86_64
Alert Count                   1
First Seen                    2013-05-22 21:14:06 PDT
Last Seen                     2013-05-22 21:14:06 PDT
Local ID                      876c4f04-bf84-4219-a1a0-8de416ba1de6

Raw Audit Messages
type=AVC msg=audit(1369282446.457:381): avc:  denied  { remove_name } for  pid=2267 comm="buglist.cgi" name="bugs-journal" dev="sda2" ino=1576235 scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:httpd_sys_content_t:s0 tclass=dir


type=AVC msg=audit(1369282446.457:381): avc:  denied  { unlink } for  pid=2267 comm="buglist.cgi" name="bugs-journal" dev="sda2" ino=1576235 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:httpd_sys_content_t:s0 tclass=file


type=SYSCALL msg=audit(1369282446.457:381): arch=x86_64 syscall=unlink success=yes exit=0 a0=445c067 a1=445c067 a2=0 a3=7fff420d70e0 items=0 ppid=2164 pid=2267 auid=4294967295 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 ses=4294967295 tty=(none) comm=buglist.cgi exe=/usr/bin/perl subj=system_u:system_r:httpd_t:s0 key=(null)

Hash: buglist.cgi,httpd_t,httpd_sys_content_t,dir,remove_name

audit2allow

#============= httpd_t ==============
#!!!! This avc can be allowed using the boolean 'httpd_unified'

allow httpd_t httpd_sys_content_t:dir remove_name;
#!!!! This avc can be allowed using the boolean 'httpd_unified'

allow httpd_t httpd_sys_content_t:file unlink;

audit2allow -R
require {
	type httpd_t;
}

#============= httpd_t ==============
apache_manage_sys_content(httpd_t)


Additional info:
hashmarkername: setroubleshoot
kernel:         3.9.2-200.fc18.x86_64
type:           libreport
Comment 1 Moez Roy 2013-05-23 00:24:39 EDT
[user@localhost ~]$ sudo semanage fcontext -a -t httpd_sys_rw_content_t 'bugs-journal'
[sudo] password for user: 
[user@localhost ~]$ sudo restorecon -v 'bugs-journal'
restorecon:  lstat(bugs-journal) failed:  No such file or directory
[user@localhost ~]$
Comment 2 Miroslav Grepl 2013-05-23 04:20:24 EDT

*** This bug has been marked as a duplicate of bug 966321 ***

Note You need to log in before you can comment on or make changes to this bug.