Bug 1573019

Summary: SELinux is preventing snapd from 'open' accesses on the directory /home/ehernan5csc/snap/hiri.
Product: [Fedora] Fedora Reporter: ehernan5csc
Component: snapdAssignee: Zygmunt Krynicki <me>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 27CC: dwalsh, lvrabec, me, mgrepl, ngompa13, plautrba, pmoore
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:ff7056eda582d4cc96172fbffbc0770c11e02c65c9841023ea21d12cf2a7171f;VARIANT_ID=workstation;
Fixed In Version: snapd-2.35-1.fc29 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-09-18 06:20:53 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description ehernan5csc 2018-04-29 20:23:02 UTC
Description of problem:
It happened while installing hiri with snap (snap install hiri)
SELinux is preventing snapd from 'open' accesses on the directory /home/ehernan5csc/snap/hiri.

*****  Plugin restorecon (99.5 confidence) suggests   ************************

If you want to fix the label. 
/home/ehernan5csc/snap/hiri default label should be snappy_home_t.
Then you can run restorecon. The access attempt may have been stopped due to insufficient permissions to access a parent directory in which case try to change the following command accordingly.
# /sbin/restorecon -v /home/ehernan5csc/snap/hiri

*****  Plugin catchall (1.49 confidence) suggests   **************************

If you believe that snapd should be allowed open access on the hiri directory 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:
# ausearch -c 'snapd' --raw | audit2allow -M my-snapd
# semodule -X 300 -i my-snapd.pp

Additional Information:
Source Context                system_u:system_r:snappy_t:s0
Target Context                unconfined_u:object_r:user_home_t:s0
Target Objects                /home/ehernan5csc/snap/hiri [ dir ]
Source                        snapd
Source Path                   snapd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-283.32.fc27.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.16.4-200.fc27.x86_64 #1 SMP Tue
                              Apr 24 23:19:54 UTC 2018 x86_64 x86_64
Alert Count                   9
First Seen                    2018-04-15 17:15:55 EDT
Last Seen                     2018-04-29 16:02:07 EDT
Local ID                      04ec0c98-efbc-49a3-8e89-b3f371a6ae58

Raw Audit Messages
type=AVC msg=audit(1525032127.601:596): avc:  denied  { open } for  pid=7821 comm="snapd" path="/home/ehernan5csc/snap/hiri" dev="dm-2" ino=46399561 scontext=system_u:system_r:snappy_t:s0 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=dir permissive=1

Hash: snapd,snappy_t,user_home_t,dir,open

Version-Release number of selected component:

Additional info:
component:      selinux-policy
reporter:       libreport-2.9.3
hashmarkername: setroubleshoot
kernel:         4.16.4-200.fc27.x86_64
type:           libreport

Comment 1 Fedora Update System 2018-09-09 06:33:53 UTC
snapd-2.35-1.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2018-d6660293c6

Comment 2 Fedora Update System 2018-09-09 20:23:35 UTC
snapd-2.35-1.fc29 has been pushed to the Fedora 29 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-2018-d6660293c6

Comment 3 Fedora Update System 2018-09-18 06:20:53 UTC
snapd-2.35-1.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.