Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 456387 - selinux: /var/log/BackupPC/UserEmailInfo.pl mislabeled
Summary: selinux: /var/log/BackupPC/UserEmailInfo.pl mislabeled
Keywords:
Status: CLOSED DUPLICATE of bug 512035
Alias: None
Product: Fedora
Classification: Fedora
Component: BackupPC
Version: 9
Hardware: x86_64
OS: Linux
low
low
Target Milestone: ---
Assignee: Johan Cwiklinski
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-07-23 09:45 UTC by Joel Uckelman
Modified: 2009-09-18 13:40 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-07-14 15:36:25 UTC


Attachments (Terms of Use)

Description Joel Uckelman 2008-07-23 09:45:18 UTC
Description of problem:

selinux refuses access to /var/log/BackupPC/UserEmailInfo.pl by perl.



Version-Release number of selected component (if applicable):

selinux-policy-3.3.1-78.fc9.noarch


How reproducible:

Always.


Steps to Reproduce:
1.  View BackupPC pages via a browser.
  
Actual results:

setroubleshoot pops up a warning.


Expected results:

No warning?


Additional info:

Here's the alert from setroubleshoot:


Summary:

SELinux is preventing the perl5.10.0 from using potentially mislabeled files
/var/log/BackupPC/UserEmailInfo.pl (var_log_t).

Detailed Description:

SELinux has denied the perl5.10.0 access to potentially mislabeled files
/var/log/BackupPC/UserEmailInfo.pl. This means that SELinux will not allow httpd
to use these files. Many third party apps install html files in directories that
SELinux policy cannot predict. These directories have to be labeled with a file
context which httpd can access.

Allowing Access:

If you want to change the file context of /var/log/BackupPC/UserEmailInfo.pl so
that the httpd daemon can access it, you need to execute it using chcon -t
httpd_sys_content_t '/var/log/BackupPC/UserEmailInfo.pl'. You can look at the
httpd_selinux man page for additional information.

Additional Information:

Source Context                system_u:system_r:httpd_t:s0
Target Context                system_u:object_r:var_log_t:s0
Target Objects                /var/log/BackupPC/UserEmailInfo.pl [ file ]
Source                        perl5.10.0
Source Path                   /usr/bin/perl5.10.0
Port                          <Unknown>
Host                          scylla.ellipsis.cx
Source RPM Packages           perl-5.10.0-30.fc9
Target RPM Packages           
Policy RPM                    selinux-policy-3.3.1-78.fc9
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Enforcing
Plugin Name                   httpd_bad_labels
Host Name                     scylla.ellipsis.cx
Platform                      Linux scylla.ellipsis.cx 2.6.25.10-86.fc9.x86_64
                              #1 SMP Mon Jul 7 20:23:46 EDT 2008 x86_64 x86_64
Alert Count                   3
First Seen                    Mon 21 Jul 2008 07:40:37 PM CEST
Last Seen                     Wed 23 Jul 2008 11:28:10 AM CEST
Local ID                      9d448d4a-a10d-44be-8ff8-333142c2b89c
Line Numbers                  

Raw Audit Messages            

host=scylla.ellipsis.cx type=AVC msg=audit(1216805290.717:24): avc:  denied  {
getattr } for  pid=5317 comm="perl5.10.0"
path="/var/log/BackupPC/UserEmailInfo.pl" dev=dm-1 ino=461832
scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:var_log_t:s0
tclass=file

host=scylla.ellipsis.cx type=SYSCALL msg=audit(1216805290.717:24): arch=c000003e
syscall=4 success=no exit=-13 a0=23724f8 a1=210f130 a2=210f130 a3=0 items=0
ppid=2253 pid=5317 auid=4294967295 uid=48 gid=48 euid=494 suid=494 fsuid=494
egid=48 sgid=48 fsgid=48 tty=(none) ses=4294967295 comm="perl5.10.0"
exe="/usr/bin/perl5.10.0" subj=system_u:system_r:httpd_t:s0 key=(null)

Comment 1 Daniel Walsh 2008-07-24 11:07:24 UTC
What package owns this file?

rpm -qf /var/log/BackupPC/UserEmailInfo.pl 

Why is it in such a stange place?

If you copied this file to /etc/BackupPC where BackupPC seems to store its perl
code or somewhere under /usr/share/BackupPC  it would also work.

If you chcon -t /var/log/BackupPC/UserEmailInfo.pl it should fix the problem
temporarily.  But this file should be moved.


Comment 2 Joel Uckelman 2008-07-24 12:12:05 UTC
According to rpm, the file is unowned.

UserEmailInfo.pl is kind of anomalous, in that it is both a log file
generated by BackupPC *and* a syntactically correct block of Perl,
which I assume is intended to be imported and executed by some other
part of BackupPC using 'eval', 'use', or 'require'.

According to the BackupPC docs
(http://backuppc.sourceforge.net/faq/BackupPC.html) UserEmailInfo.pl is
"A summary of what email was last sent to each user, and when the last email
was sent." Moving it to /usr/share/BackupPC would be wrong because it's
a log file. And regardless, simply moving it to /etc/BackupPC or
/usr/share/BackupPC without changing BackupPC wouldn't work, since it
wouldn't know to look in those places.


Comment 3 Josef Kubin 2008-07-25 13:04:02 UTC
You can add an exception for it to SELinux policy:

# semanage fcontext -a -t httpd_log_t /var/log/BackupPC/UserEmailInfo.pl

And it should fix your problem.

Comment 4 Johan Cwiklinski 2008-07-27 22:59:50 UTC
I'm currently working on a new policy for BackupPC-3.1.0.

As BackupPC comes with its own SELinux policy, I think it could be reassigned.

For now, new policy is not ready at all, you could temporary put the correct
selinux context with chcon, using httpd_log_log as proposed by Josef, or
httpd_sys_content_t ; one should does the trick.



Comment 5 Bug Zapper 2009-06-10 02:11:32 UTC
This message is a reminder that Fedora 9 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 9.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '9'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 9's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 9 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 6 Bug Zapper 2009-07-14 15:36:25 UTC
Fedora 9 changed to end-of-life (EOL) status on 2009-07-10. Fedora 9 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 7 Johan Cwiklinski 2009-09-18 13:40:04 UTC

*** This bug has been marked as a duplicate of bug 512035 ***


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