Bug 751307

Summary: SELinux is preventing /usr/lib/cups/backend/cups-pdf from 'read' accesses on the lnk_file /home/dan/Documents.
Product: [Fedora] Fedora Reporter: Dan Ziemba <zman0900>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 16CC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:1c9b2e2b7b318b4a931fb7d0ba349046740d0132e30a2a047deb22a182ca701b
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-11-04 11:02:45 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 Dan Ziemba 2011-11-04 09:40:29 UTC
libreport version: 2.0.6
executable:     /usr/bin/python
hashmarkername: setroubleshoot
kernel:         3.1.0-5.fc16.x86_64
reason:         SELinux is preventing /usr/lib/cups/backend/cups-pdf from 'read' accesses on the lnk_file /home/dan/Documents.
time:           Fri Nov  4 05:39:11 2011

description:
:SELinux is preventing /usr/lib/cups/backend/cups-pdf from 'read' accesses on the lnk_file /home/dan/Documents.
:
:*****  Plugin catchall (100. confidence) suggests  ***************************
:
:If you believe that cups-pdf should be allowed read access on the Documents lnk_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 cups-pdf /var/log/audit/audit.log | audit2allow -M mypol
:# semodule -i mypol.pp
:
:Additional Information:
:Source Context                system_u:system_r:cups_pdf_t:s0-s0:c0.c1023
:Target Context                unconfined_u:object_r:user_home_t:s0
:Target Objects                /home/dan/Documents [ lnk_file ]
:Source                        cups-pdf
:Source Path                   /usr/lib/cups/backend/cups-pdf
:Port                          <Unknown>
:Host                          (removed)
:Source RPM Packages           cups-pdf-2.5.1-1.fc16
:Target RPM Packages           
:Policy RPM                    selinux-policy-3.10.0-53.fc16
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Enforcing
:Host Name                     (removed)
:Platform                      Linux zman0900 3.1.0-5.fc16.x86_64 #1 SMP Thu Oct
:                              27 03:46:50 UTC 2011 x86_64 x86_64
:Alert Count                   2
:First Seen                    Fri 04 Nov 2011 05:19:55 AM EDT
:Last Seen                     Fri 04 Nov 2011 05:21:57 AM EDT
:Local ID                      125df296-6e2f-44ac-991f-0391a236958d
:
:Raw Audit Messages
:type=AVC msg=audit(1320398517.544:711): avc:  denied  { read } for  pid=4380 comm="cups-pdf" name="Documents" dev=dm-6 ino=130322 scontext=system_u:system_r:cups_pdf_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=lnk_file
:
:
:type=SYSCALL msg=audit(1320398517.544:711): arch=x86_64 syscall=stat success=no exit=EACCES a0=bf95e0 a1=7fff32876440 a2=7fff32876440 a3=0 items=0 ppid=4374 pid=4380 auid=4294967295 uid=0 gid=7 euid=0 suid=0 fsuid=0 egid=7 sgid=7 fsgid=7 tty=(none) ses=4294967295 comm=cups-pdf exe=/usr/lib/cups/backend/cups-pdf subj=system_u:system_r:cups_pdf_t:s0-s0:c0.c1023 key=(null)
:
:Hash: cups-pdf,cups_pdf_t,user_home_t,lnk_file,read
:
:audit2allow
:
:#============= cups_pdf_t ==============
:allow cups_pdf_t user_home_t:lnk_file read;
:
:audit2allow -R
:
:#============= cups_pdf_t ==============
:allow cups_pdf_t user_home_t:lnk_file read;
:

Comment 1 Dan Ziemba 2011-11-04 09:48:25 UTC
The problems seems to be that selinux is not allowing cups-pdf to follow symlinks when trying to write a pdf to it's output location.  I edited /etc/cups/cups-pdf.conf and changed "Out ${DESKTOP}" to "Out ${HOME}/Documents" since GNOME 3 has no desktop icons.  The problem is that I have replace my ~/Documents folder (and sever others) with a symlink to a folder on another filesystem that has more space.  I've tried setting "Out" to a regular folder in my home and that works fine.  I don't know a lot about selinux, but to me it seems reasonable that it should allow something like this to follow a symlink.

Output in /var/log/messages:
Fri Nov  4 05:21:57 2011  [ERROR] failed to create directory (/home/dan/Documents)
Fri Nov  4 05:21:57 2011  [ERROR] failed to create user output directory (/home/dan/Documents)

Comment 2 Miroslav Grepl 2011-11-04 11:02:45 UTC
This is a local customization. Yes, we allow to use a regular folder in /home but not a symlink.

# grep cups-pdf /var/log/audit/audit.log | audit2allow -M mycups
# semodule -i mycups.pp

will fix.