Bug 951570 - SELinux is preventing /usr/bin/perl from 'create' accesses on the directory .spamassassin.
Summary: SELinux is preventing /usr/bin/perl from 'create' accesses on the directory ....
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 18
Hardware: x86_64
OS: Unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
Whiteboard: abrt_hash:ed71f4dcaed5286e159f789adbf...
Depends On:
TreeView+ depends on / blocked
Reported: 2013-04-12 13:41 UTC by Juan Orti Alcaine
Modified: 2013-04-18 02:52 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2013-04-18 02:52:34 UTC

Attachments (Terms of Use)

Description Juan Orti Alcaine 2013-04-12 13:41:30 UTC
Description of problem:
I have created the spamd user for the spamassassin stuff.
I have added "-u spamd" in /etc/sysconfig/spamassassin:
SPAMDOPTIONS="-d -c -m5 -H -u spamd"
And chown -R spamd:spamd /var/lib/spamassassin

With the default setup I get a lot of errors like:
config: cannot create user preferences file /var/lib/spamassassin/.spamassassin/user_prefs: No existe el fichero o el directorio
plugin: eval failed: bayes: (in learn) locker: safe_lock: cannot create tmp lockfile /var/lib/spamassassin/.spamassassin/bayes.lock.foo.example.com.1776 for /var/lib/spamassassin/.spamassassin/bayes.lock: No existe el fichero o el directorio
SELinux is preventing /usr/bin/perl from 'create' accesses on the directory .spamassassin.

*****  Plugin catchall (100. confidence) suggests  ***************************

If cree que de manera predeterminada, perl debería permitir acceso create sobre  .spamassassin directory.     
Then debería reportar esto como un error.
Puede generar un módulo de política local para permitir este acceso.
permita el acceso momentáneamente executando:
# grep 7370616D64206368696C64 /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                system_u:object_r:spamd_var_lib_t:s0
Target Objects                .spamassassin [ dir ]
Source                        7370616D64206368696C64
Source Path                   /usr/bin/perl
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           perl-5.16.3-241.fc18.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.11.1-87.fc18.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.8.6-203.fc18.x86_64 #1 SMP Tue
                              Apr 9 19:33:01 UTC 2013 x86_64 x86_64
Alert Count                   4
First Seen                    2013-04-12 15:36:04 CEST
Last Seen                     2013-04-12 15:36:09 CEST
Local ID                      d6288a03-66b5-4428-91a3-4692798a63ff

Raw Audit Messages
type=AVC msg=audit(1365773769.300:448): avc:  denied  { create } for  pid=2440 comm=7370616D64206368696C64 name=".spamassassin" scontext=system_u:system_r:spamd_t:s0 tcontext=system_u:object_r:spamd_var_lib_t:s0 tclass=dir

type=SYSCALL msg=audit(1365773769.300:448): arch=x86_64 syscall=mkdir success=no exit=EACCES a0=5b46df0 a1=1c0 a2=7f75eaf60a1c a3=0 items=0 ppid=1922 pid=2440 auid=4294967295 uid=0 gid=0 euid=987 suid=0 fsuid=987 egid=983 sgid=0 fsgid=983 ses=4294967295 tty=(none) comm=7370616D64206368696C64 exe=/usr/bin/perl subj=system_u:system_r:spamd_t:s0 key=(null)

Hash: 7370616D64206368696C64,spamd_t,spamd_var_lib_t,dir,create


#============= spamd_t ==============
allow spamd_t spamd_var_lib_t:dir create;

audit2allow -R
require {
	type spamd_var_lib_t;
	type spamd_t;
	class dir create;

#============= spamd_t ==============
allow spamd_t spamd_var_lib_t:dir create;

Additional info:
hashmarkername: setroubleshoot
kernel:         3.8.6-203.fc18.x86_64
type:           libreport

Comment 1 Daniel Walsh 2013-04-12 18:30:56 UTC
cf16bef73c03c8b8926f9db0748dfe11cd555e22 fixes this in git.

Comment 2 Miroslav Grepl 2013-04-15 05:51:13 UTC
Back ported.

Comment 3 Fedora Update System 2013-04-15 11:12:31 UTC
selinux-policy-3.11.1-90.fc18 has been submitted as an update for Fedora 18.

Comment 4 Fedora Update System 2013-04-16 00:08:01 UTC
Package selinux-policy-3.11.1-90.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing selinux-policy-3.11.1-90.fc18'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).

Comment 5 Fedora Update System 2013-04-18 02:52:36 UTC
selinux-policy-3.11.1-90.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.

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