Bug 1002142 - mock --copyout breaks cleanup of the selinux plug-in
Summary: mock --copyout breaks cleanup of the selinux plug-in
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: mock
Version: rawhide
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: Jon Disnard
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-08-28 13:47 UTC by Kamil Dudka
Modified: 2016-03-03 09:05 UTC (History)
3 users (show)

Fixed In Version: mock-1.1.38-1.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-02-08 05:02:47 UTC
Type: Bug
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1312820 0 high CLOSED Lots of WARNING: unable to delete selinux filesystems 2021-02-22 00:41:40 UTC

Internal Links: 1312820

Description Kamil Dudka 2013-08-28 13:47:32 UTC
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-03 02:17:50 UTC
Created attachment 858344 [details]
drop privs temporarily in copyout for selinux

Comment 2 Jon Disnard 2014-02-03 02:27:24 UTC
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 20:23:10 UTC
Applied, should go into 1.1.36 build

Comment 4 Fedora Update System 2014-02-06 02:09:09 UTC
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-06 02:10:50 UTC
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-06 02:12:21 UTC
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 21:08:19 UTC
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 05:02:47 UTC
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 20:25:02 UTC
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 20:27:30 UTC
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 20:29:31 UTC
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 17:48:03 UTC
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 17:50:00 UTC
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 17:51:51 UTC
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 19:04:40 UTC
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 19:07:02 UTC
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 19:08:58 UTC
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 13:19:01 UTC
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 15:37:53 UTC
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 09:20:11 UTC
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.