Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be available on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 982203 - SELinux is preventing /usr/bin/python2.7 from 'create' accesses on the file strings.pyc.
Summary: SELinux is preventing /usr/bin/python2.7 from 'create' accesses on the file s...
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 19
Hardware: x86_64
OS: Unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
Whiteboard: abrt_hash:17d85f0974c21f98affb8e7ae86...
: 1319423 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2013-07-08 11:42 UTC by Vadim
Modified: 2016-03-21 12:52 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2013-07-08 18:48:58 UTC
Type: ---

Attachments (Terms of Use)

Description Vadim 2013-07-08 11:42:32 UTC
Description of problem:
Have installed ./hplip-3.13.6.bin
SELinux is preventing /usr/bin/python2.7 from 'create' accesses on the file strings.pyc.

*****  Plugin catchall_labels (83.8 confidence) suggests  ********************

If you want to allow python2.7 to have create access on the strings.pyc file
Then you need to change the label on strings.pyc
# semanage fcontext -a -t FILE_TYPE 'strings.pyc'
where FILE_TYPE is one of the following: cupsd_interface_t, cupsd_lock_t, cupsd_log_t, cupsd_rw_etc_t, cupsd_tmp_t, cupsd_var_lib_t, cupsd_var_run_t, krb5_host_rcache_t, print_spool_t. 
Then execute: 
restorecon -v 'strings.pyc'

*****  Plugin catchall (17.1 confidence) suggests  ***************************

If you believe that python2.7 should be allowed create access on the strings.pyc file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
allow this access for now by executing:
# grep python /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:cupsd_t:s0-s0:c0.c1023
Target Context                system_u:object_r:usr_t:s0
Target Objects                strings.pyc [ file ]
Source                        python
Source Path                   /usr/bin/python2.7
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           python-2.7.5-1.fc19.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.12.1-59.fc19.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.9.9-301.fc19.x86_64 #1 SMP Thu
                              Jul 4 15:10:36 UTC 2013 x86_64 x86_64
Alert Count                   19
First Seen                    2013-07-08 12:34:59 IST
Last Seen                     2013-07-08 12:34:59 IST
Local ID                      adda979e-a951-4454-a2ff-d0e2311108d7

Raw Audit Messages
type=AVC msg=audit(1373283299.217:493): avc:  denied  { create } for  pid=2218 comm="python" name="strings.pyc" scontext=system_u:system_r:cupsd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:usr_t:s0 tclass=file

type=SYSCALL msg=audit(1373283299.217:493): arch=x86_64 syscall=open success=no exit=EACCES a0=1f5a410 a1=2c1 a2=81a4 a3=3bf83c15d0 items=0 ppid=2204 pid=2218 auid=4294967295 uid=0 gid=7 euid=0 suid=0 fsuid=0 egid=7 sgid=7 fsgid=7 ses=4294967295 tty=(none) comm=python exe=/usr/bin/python2.7 subj=system_u:system_r:cupsd_t:s0-s0:c0.c1023 key=(null)

Hash: python,cupsd_t,usr_t,file,create

Additional info:
reporter:       libreport-2.1.5
hashmarkername: setroubleshoot
kernel:         3.9.9-301.fc19.x86_64
type:           libreport

Comment 1 Daniel Walsh 2013-07-08 18:48:58 UTC
This looks like you removed the python compiled code.

Run python strings.py by hand should eliminate this AVC.

Comment 2 Lukas Vrabec 2016-03-21 12:52:52 UTC
*** Bug 1319423 has been marked as a duplicate of this bug. ***

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