Bug 520765 - selinux prevents fetchmail from accessing .fetchmailrc
Summary: selinux prevents fetchmail from accessing .fetchmailrc
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: selinux-policy-targeted
Version: 5.4
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Daniel Walsh
QA Contact: BaseOS QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-09-02 09:42 UTC by Ales Zelinka
Modified: 2014-11-18 20:45 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-10-27 10:57:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
complete audit log from new run (33.69 KB, text/plain)
2009-10-16 11:31 UTC, Ales Zelinka
no flags Details

Description Ales Zelinka 2009-09-02 09:42:25 UTC
Description of problem:
See run of /CoreOS/fetchmail/Sanity/smoke: http://rhts.redhat.com/cgi-bin/rhts/jobs.cgi?id=86909

With "enforcing 1"  (Test-pop3-SEON subtest) fetchmail fails with this mesasge: 
fetchmail: couldn't time-check the run-control file
fetchmail: lstat: /home/fm2/.fetchmailrc: Permission denied

No AVC logged.

With "enforcing 0" (Test-pop3-SEOFF) fetchmail downloads mail successfully.

AVC is logged (Test-pop3-SEOFF/avc), but it is probably another story and will end up as separate bug.

I'm not sure what exactly happened when in enforcing mode so I did one more run with dont-audit rules turned off:

http://rhts.redhat.com/cgi-bin/rhts/jobs.cgi?id=86936&type=single


Version-Release number of selected component (if applicable):
selinux-policy-targeted-2.4.6-255.el5.noarch


How reproducible:
always

Steps to Reproduce:
1.schedule /CoreOS/fetchmail/Sanity/smoke for RHEL5.3
  
Actual results:
http://rhts.redhat.com/cgi-bin/rhts/jobs.cgi?id=86909
http://rhts.redhat.com/cgi-bin/rhts/jobs.cgi?id=86936

Expected results:
PASS of both pop3 and imap parts of the test with selinux in enforcing mode

Comment 1 Daniel Walsh 2009-09-04 14:27:52 UTC
Please attach the audit log.  I do not seem to be allowed to login.

Comment 2 Ales Zelinka 2009-10-16 11:30:08 UTC
Aw, sorry, I have missed your previous comment, hope you don't mind me reopening this bug. I'll attach the requested file ASAP.

Comment 3 Ales Zelinka 2009-10-16 11:31:06 UTC
Created attachment 365037 [details]
complete audit log from new run

Comment 5 Daniel Walsh 2009-10-16 12:55:26 UTC
Ales is this test supposed to be the equivalence of  a user running fetchmail?

If so then we need to run each fetchmail command with 

runcon -t unconfined_t fetchmail ...

Fetchmail being run out of a init process will run as fetchmail_t, fetchmail run as a user will stay in the users domain.  So if you run fetchmail as unoconfined_t it will stay as unconfined_t. rhts tests run out of init so by default they run as initrc_t which will transition to fetchmail_t and not be allowed to write to the users home dir.

Comment 6 Ales Zelinka 2009-10-27 10:57:31 UTC
That's it. Thanks for the tip, Daniel!


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