Bug 1241548

Summary: SELinux is preventing hpps from 'create' accesses on the file cups.cpython-34.pyc.139838732894256.
Product: [Fedora] Fedora Reporter: Sreekand <pommilery>
Component: hplipAssignee: Tim Waugh <twaugh>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: brian, cutnioff, D8F55524, dominick.grift, dwalsh, jpopelka, lvrabec, mgrepl, plautrba, pommilery, twaugh
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:fd59c2c37acbec3a98b2fb1cb77ce42f83386a674199fdca8036359273d76c85
Fixed In Version: hplip-3.15.11-4.fc23 hplip-3.15.9-3.fc22 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-01-07 19:54:04 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
File: screencast-07-09-2015-05:35:30 PM.webm none

Description Sreekand 2015-07-09 13:06:49 UTC
Description of problem:
SELinux is preventing hpps from create access on the file cups.cpython-34.pyc.139838732894256.

Plugin: catchall 
you want to allow hpps to have create access on the
cups.cpython-34.pyc.139838732894256 fileIf you believe that hpps should be allowed create access on the cups.cpython-34.pyc.139838732894256 file by default.
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 hpps /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp
SELinux is preventing hpps from 'create' accesses on the file cups.cpython-34.pyc.139838732894256.

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

If you want to allow hpps to have create access on the cups.cpython-34.pyc.139838732894256 file
Then you need to change the label on cups.cpython-34.pyc.139838732894256
Do
# semanage fcontext -a -t FILE_TYPE 'cups.cpython-34.pyc.139838732894256'
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 'cups.cpython-34.pyc.139838732894256'


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

If you believe that hpps should be allowed create access on the cups.cpython-34.pyc.139838732894256 file 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 hpps /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                cups.cpython-34.pyc.139838732894256 [ file ]
Source                        hpps
Source Path                   hpps
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-128.2.fc22.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.0.6-300.fc22.x86_64 #1 SMP Tue
                              Jun 23 13:58:53 UTC 2015 x86_64 x86_64
Alert Count                   34
First Seen                    2015-06-28 13:27:15 AFT
Last Seen                     2015-07-09 15:08:33 AFT
Local ID                      db6bd0b4-39ab-44ce-85b8-bcd204dcc74b

Raw Audit Messages
type=AVC msg=audit(1436438313.666:642): avc:  denied  { create } for  pid=3829 comm="hpps" name="cups.cpython-34.pyc.139838732894256" scontext=system_u:system_r:cupsd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:usr_t:s0 tclass=file permissive=0


Hash: hpps,cupsd_t,usr_t,file,create

Version-Release number of selected component:
selinux-policy-3.13.1-128.2.fc22.noarch

Additional info:
reporter:       libreport-2.6.0
hashmarkername: setroubleshoot
kernel:         4.0.6-300.fc22.x86_64
type:           libreport

Comment 1 Sreekand 2015-07-09 13:06:55 UTC
Created attachment 1050284 [details]
File: screencast-07-09-2015-05:35:30 PM.webm

Comment 2 Seb L. 2015-08-31 07:42:50 UTC
Description of problem:
Got this error while trying to print a C document from gedit on a HP LaserJet printer.

Version-Release number of selected component:
selinux-policy-3.13.1-128.12.fc22.noarch

Additional info:
reporter:       libreport-2.6.2
hashmarkername: setroubleshoot
kernel:         4.1.3-200.fc22.x86_64
type:           libreport

Comment 3 Miroslav Grepl 2015-08-31 12:13:20 UTC
Where is cups.cpython-34.pyc.139838732894256 located? 

Try to execute 

# restorecon -R -v /usr/share/cups

to see if it helps.

Comment 4 Jiri Popelka 2016-01-04 15:06:19 UTC
*** Bug 1290341 has been marked as a duplicate of this bug. ***

Comment 5 Jiri Popelka 2016-01-04 15:21:12 UTC
# head -n1 /usr/lib/cups/filter/hpps
#!/usr/bin/python3

Do we need to add -B switch as in bug #1266903, comment #2 ?
Does anybody have any idea why python tries to create the
/usr/share/hplip/prnt/__pycache__/cups.cpython-34.pyc.139838732894256
even there already is cups.cpython-34.pyc ?

Comment 6 Fedora Update System 2016-01-04 16:34:45 UTC
hplip-3.15.11-4.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-ddd5d2a5a2

Comment 7 Fedora Update System 2016-01-06 00:25:16 UTC
hplip-3.15.9-3.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-d53f75537d

Comment 8 Fedora Update System 2016-01-06 00:30:08 UTC
hplip-3.15.11-4.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-ddd5d2a5a2

Comment 9 Fedora Update System 2016-01-07 19:53:58 UTC
hplip-3.15.11-4.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2016-01-14 09:49:55 UTC
hplip-3.15.9-3.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.

Comment 11 Red Hat Bugzilla 2023-09-14 03:01:48 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days