Bug 455856 - Func needs to maintain SELinux file context
Func needs to maintain SELinux file context
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: func (Show other bugs)
10
All Linux
low Severity low
: ---
: ---
Assigned To: Bryan Kearney
Fedora Extras Quality Assurance
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-07-18 08:27 EDT by Daniel Walsh
Modified: 2014-01-21 18:03 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-12-18 01:15:17 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Daniel Walsh 2008-07-18 08:27:22 EDT
Description of problem:

Not sure if this is a bug or not, since I have never used func.  We found puppet
was not respecting SELinux labeling and causing files to be mislabed which can
break the system.  When Func installs files it has to make sure the labels on
the files are correct for that system.  As an example if func installed an
update to /etc/services or /etc/nsswitch and labeled it incorrectly most of the
confined network daemons would start to get access denied and may blow up.

SELinux has a couple of system calls that can be used to assure this.  C, Python
and Ruby bindings now exist for libselinux.

( rc, con) = matchpathcon(PATH,MODE)

Will give you an SELinux file context to assign to a file.

setfscreatecon(file, con)

Tells the kernel that all files in the future created by this process will be
created with the context "con".

setfilecon(file, con)  Change the file context of an existing file to "con".

If you already do this correctly then thanks, and close this bugzilla.
Comment 1 Michael DeHaan 2008-07-18 08:46:57 EDT
Daniel,

Thanks for the heads up.

If using the copyfile module right now (which is essentially just scp) it would
just depend on the current directory/file context.   I am not sure if we have
this bug or not, but I imagine if files in /etc have different context and we
overwrite one with the equivalent of a scp, how that context might not be the same?

Func is a Python app, so I suppose we will need to look into the shell
equivalents if there is not a selinux python module available.  Might be neat to
have one :)

Comment 2 Daniel Walsh 2008-07-18 09:56:43 EDT
If the file exists it would be best to keep the current context.  Probably what
you do now.   I probably should open a similar bug on scp.  There are python
bindings,  most of SELinux tools are written in python and the pseudo code I
wrote above is python based.

I guess if you could just experiment and distribute a /etc/resolv.conf and make
sure it ends up as net_conf_t.  Try with the resolv.conf file there and with it
missing.
Comment 3 Bug Zapper 2008-11-25 21:34:47 EST
This bug appears to have been reported against 'rawhide' during the Fedora 10 development cycle.
Changing version to '10'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 5 Bug Zapper 2009-11-18 07:36:55 EST
This message is a reminder that Fedora 10 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 10.  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 '10'.

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 10'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 10 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-12-18 01:15:17 EST
Fedora 10 changed to end-of-life (EOL) status on 2009-12-17. Fedora 10 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.

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