Bug 1002142 - mock --copyout breaks cleanup of the selinux plug-in
mock --copyout breaks cleanup of the selinux plug-in
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: mock (Show other bugs)
rawhide
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Jon Disnard
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-28 09:47 EDT by Kamil Dudka
Modified: 2016-03-03 04:05 EST (History)
3 users (show)

See Also:
Fixed In Version: mock-1.1.38-1.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-02-08 00:02:47 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
drop privs temporarily in copyout for selinux (691 bytes, patch)
2014-02-02 21:17 EST, Jon Disnard
no flags Details | Diff

  None (edit)
Description Kamil Dudka 2013-08-28 09:47:32 EDT
Description of problem:
A warning is printed.  Temporary file is not removed when mock finishes.


Version-Release number of selected component (if applicable):
mock-1.1.33-1.fc21


How reproducible:
100%


Steps to Reproduce:
1. mock --init
2. mock --copyout /etc/resolv.conf /tmp/


Actual results:
WARNING: unable to delete selinux filesystems (/tmp/mock-selinux-plugin.SCQnfa): [Errno 1] Operation not permitted: '/tmp/mock-selinux-plugin.SCQnfa'


Expected results:
No warnings printed.  /tmp/mock-selinux-plugin.?????? removed.


Additional info:
Using --disable-plugin=selinux together with --copyout fixes the problem.
Comment 1 Jon Disnard 2014-02-02 21:17:50 EST
Created attachment 858344 [details]
drop privs temporarily in copyout for selinux
Comment 2 Jon Disnard 2014-02-02 21:27:24 EST
William,

The selinux.py plugin has code that runs privledged durring setup phase:

_selinuxCreateFauxFilesystems()



But the code to tear-down the above runs as regular user in the case of "copyout". 

_selinuxAtExit()


Honestly I feel the selinux plugin could do a better job of handling the faux filesystem. This is just a copy of the host system's /proc/filesystems, sans any lines containing "selinuxfs". But perhaps I do not appreciate what happens in the chroot with the faux filesystems later on(?), I'm just not sure the temporary copy needs to be owned by root.

So the above patch avoids touching selinux plugin. It restores privs so the temporary file can be removed. 

Thanks for looking it over.
Comment 3 Clark Williams 2014-02-03 15:23:10 EST
Applied, should go into 1.1.36 build
Comment 4 Fedora Update System 2014-02-05 21:09:09 EST
mock-1.1.36-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/mock-1.1.36-1.fc19
Comment 5 Fedora Update System 2014-02-05 21:10:50 EST
mock-1.1.36-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/mock-1.1.36-1.fc20
Comment 6 Fedora Update System 2014-02-05 21:12:21 EST
mock-1.1.36-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.1.36-1.el6
Comment 7 Fedora Update System 2014-02-06 16:08:19 EST
Package mock-1.1.36-1.el6:
* should fix your issue,
* was pushed to the Fedora EPEL 6 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=epel-testing mock-1.1.36-1.el6'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-EPEL-2014-0467/mock-1.1.36-1.el6
then log in and leave karma (feedback).
Comment 8 Fedora Update System 2014-02-08 00:02:47 EST
mock-1.1.36-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 9 Fedora Update System 2014-03-25 16:25:02 EDT
mock-1.1.37-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/mock-1.1.37-1.fc19
Comment 10 Fedora Update System 2014-03-25 16:27:30 EDT
mock-1.1.37-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/mock-1.1.37-1.fc20
Comment 11 Fedora Update System 2014-03-25 16:29:31 EDT
mock-1.1.37-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.1.37-1.el6
Comment 12 Fedora Update System 2014-03-27 13:48:03 EDT
mock-1.1.37-2.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/mock-1.1.37-2.fc20
Comment 13 Fedora Update System 2014-03-27 13:50:00 EDT
mock-1.1.37-2.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/mock-1.1.37-2.fc19
Comment 14 Fedora Update System 2014-03-27 13:51:51 EDT
mock-1.1.37-2.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.1.37-2.el6
Comment 15 Fedora Update System 2014-03-31 15:04:40 EDT
mock-1.1.38-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/mock-1.1.38-1.fc19
Comment 16 Fedora Update System 2014-03-31 15:07:02 EDT
mock-1.1.38-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.1.38-1.el6
Comment 17 Fedora Update System 2014-03-31 15:08:58 EDT
mock-1.1.38-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/mock-1.1.38-1.fc20
Comment 18 Fedora Update System 2014-04-09 09:19:01 EDT
mock-1.1.38-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 19 Fedora Update System 2014-04-18 11:37:53 EDT
mock-1.1.38-1.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 20 Fedora Update System 2014-04-19 05:20:11 EDT
mock-1.1.38-1.el6 has been pushed to the Fedora EPEL 6 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.