Bug 708382

Summary: SELinux is preventing /usr/bin/perl from 'getattr' accesses on the dossier /home/username/.spamassassin.
Product: [Fedora] Fedora Reporter: Donald Fillion <dfillion>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 15CC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:6cc015b9f8e5062008a848841ca63bc8378e2ca7fded641ee81998132d717c8b
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-27 14:30:37 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 Donald Fillion 2011-05-27 14:16:27 UTC
SELinux is preventing /usr/bin/perl from 'getattr' accesses on the dossier /home/username/.spamassassin.

*****  Plugin restorecon (92.2 confidence) suggests  *************************

If you want to fix the label. 
/home/username/.spamassassin default label should be spamc_home_t.
Then you can run restorecon.
Do
# /sbin/restorecon -v /home/username/.spamassassin

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

If you want to allow spamd to read/write user home directories.
Then you must tell SELinux about this by enabling the 'spamd_enable_home_dirs' boolean.
Do
setsebool -P spamd_enable_home_dirs 1

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

If you believe that perl should be allowed getattr access on the .spamassassin 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 spamd /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:spamd_t:s0
Target Context                unconfined_u:object_r:user_home_t:s0
Target Objects                /home/username/.spamassassin [ dir ]
Source                        spamd
Source Path                   /usr/bin/perl
Port                          <Inconnu>
Host                          (removed)
Source RPM Packages           perl-5.12.3-157.fc15
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.16-23.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed)
                              2.6.38.6-26.rc1.fc15.i686.PAE #1 SMP Mon May 9
                              20:36:50 UTC 2011 i686 i686
Alert Count                   1
First Seen                    ven 27 mai 2011 10:11:29 EDT
Last Seen                     ven 27 mai 2011 10:11:29 EDT
Local ID                      62e95ee1-721d-4915-9770-6d4483eb2915

Raw Audit Messages
type=AVC msg=audit(1306505489.489:89): avc:  denied  { getattr } for  pid=12243 comm="spamd" path="/home/username/.spamassassin" dev=dm-2 ino=2622597 scontext=system_u:system_r:spamd_t:s0 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=dir


type=SYSCALL msg=audit(1306505489.489:89): arch=i386 syscall=stat64 success=no exit=EACCES a0=8fcd298 a1=8db90c4 a2=4876eff4 a3=8db9008 items=0 ppid=12241 pid=12243 auid=4294967295 uid=0 gid=0 euid=500 suid=0 fsuid=500 egid=500 sgid=0 fsgid=500 tty=(none) ses=4294967295 comm=spamd exe=/usr/bin/perl subj=system_u:system_r:spamd_t:s0 key=(null)

Hash: spamd,spamd_t,user_home_t,dir,getattr

audit2allow

#============= spamd_t ==============
#!!!! This avc can be allowed using the boolean 'spamd_enable_home_dirs'

allow spamd_t user_home_t:dir getattr;

audit2allow -R

#============= spamd_t ==============
#!!!! This avc can be allowed using the boolean 'spamd_enable_home_dirs'

allow spamd_t user_home_t:dir getattr;

Comment 1 Dominick Grift 2011-05-27 14:24:06 UTC
The ~/.spamassassin directory is mislabelled. This is due to you not having the policycoreutils-restorecond package installed. (this package should have been installed by default)

Please install policycoreutils-restorecond and re-login to your session.

Verify that restorecond -u is running: ps xZ | grep restorecond

Comment 2 Dominick Grift 2011-05-27 14:25:55 UTC
Also after you determined that restorecond is running in your session, please run restorecon -R -v ~, to restore the contexts in your home directory.

Comment 3 Miroslav Grepl 2011-05-27 14:30:37 UTC
Execute

# restorecon -R -v ~/

will fix the label