Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 663021 - [PATCH] Don't add --setopt=tsflags=nocontexts to all commands
Summary: [PATCH] Don't add --setopt=tsflags=nocontexts to all commands
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: mock
Version: 14
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ---
Assignee: David Cantrell
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-12-14 13:19 UTC by Paul Howarth
Modified: 2013-01-10 06:23 UTC (History)
5 users (show)

Fixed In Version: mock-1.1.10-1.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-01-21 23:04:14 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Don't add --setopt=tsflags=nocontexts to all commands (1.11 KB, text/plain)
2010-12-14 13:19 UTC, Paul Howarth
no flags Details

Description Paul Howarth 2010-12-14 13:19:15 UTC
Created attachment 468609 [details]
Don't add --setopt=tsflags=nocontexts to all commands

I already posted this on buildsys-list but it seems to have been missed.

The SELinux plugin adds a hook that adds a "--setopt=tsflags=nocontexts" option to every command routed through mock.util.do. This doesn't just include "yum" commands, as can be seen for instance if a build fails in the "setup" phase, where mock tries to unmount all mounted filesystems with a umount command with the bogus option added to each invocation.

You can see this for yourself if you try building a package that pulls in a build requirement that uses file capabilities and have the tmpfs plugin enabled; rpm/cpio cannot apply the capability on tmpfs and so the build bails out. I use "spamass-milter" in Rawhide as a nice, small package that demonstrates this effect.

WARNING: Command failed. See logs for output.
 # umount -n /var/lib/mock/city-fan-rawhide-x86_64/root/dev/shm --setopt=tsflags=nocontexts
WARNING: Command failed. See logs for output.
 # umount -n /var/lib/mock/city-fan-rawhide-x86_64/root/dev/pts --setopt=tsflags=nocontexts
WARNING: Command failed. See logs for output.
 # umount -n /var/lib/mock/city-fan-rawhide-x86_64/root/proc/filesystems --setopt=tsflags=nocontexts
WARNING: Command failed. See logs for output.
 # umount -n /var/lib/mock/city-fan-rawhide-x86_64/root/tmp/ccache --setopt=tsflags=nocontexts
WARNING: Command failed. See logs for output.
 # umount -n /var/lib/mock/city-fan-rawhide-x86_64/root/var/cache/yum --setopt=tsflags=nocontexts
WARNING: Command failed. See logs for output.
 # umount -n /var/lib/mock/city-fan-rawhide-x86_64/root/sys --setopt=tsflags=nocontexts
WARNING: Command failed. See logs for output.
 # umount -n /var/lib/mock/city-fan-rawhide-x86_64/root/proc --setopt=tsflags=nocontexts
WARNING: Forcibly unmounting '/var/lib/mock/city-fan-rawhide-x86_64/root/dev/shm' from chroot.
WARNING: Forcibly unmounting '/var/lib/mock/city-fan-rawhide-x86_64/root/dev/pts' from chroot.
WARNING: Forcibly unmounting '/var/lib/mock/city-fan-rawhide-x86_64/root/proc/filesystems' from chroot.
WARNING: Forcibly unmounting '/var/lib/mock/city-fan-rawhide-x86_64/root/tmp/ccache' from chroot.
WARNING: Forcibly unmounting '/var/lib/mock/city-fan-rawhide-x86_64/root/var/cache/yum' from chroot.
WARNING: Forcibly unmounting '/var/lib/mock/city-fan-rawhide-x86_64/root/sys' from chroot.
WARNING: Forcibly unmounting '/var/lib/mock/city-fan-rawhide-x86_64/root/proc' from chroot.

The attached patch makes the plugin only apply the extra option when the command being run is yum. Works for me, though it uses "startswith" and so won't work on python 2.4. I'm sure a native python speaker could write it in a more portable way.

Comment 1 Clark Williams 2010-12-18 16:58:36 UTC
Thanks Paul, yeah I missed it on buildsys-list. I've pulled this in and will add it to mock-1.1.8.

Comment 2 Hans Ulrich Niedermann 2011-01-13 15:18:54 UTC
I can confirm both the problem and the patch fix in a current up-to-date F14 installation withmock-1.1.7-1.fc14.noarch.

Comment 3 Paul Howarth 2011-01-13 15:31:33 UTC
The fix is included in mock 1.1.8, which you can grab here:

http://kojipkgs.fedoraproject.org/packages/mock/1.1.8/

There are a bunch of other fixes in there too. I've been using it for a week now without problems.

Comment 4 Garrett Holmstrom 2011-01-18 18:02:29 UTC
Any chance mock 1.1.8 can get pushed?  It seems to work fine.

Comment 5 Fedora Update System 2011-01-18 19:57:57 UTC
mock-1.1.8-1.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/mock-1.1.8-1.fc14

Comment 6 Fedora Update System 2011-01-18 19:58:37 UTC
mock-1.1.8-1.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/mock-1.1.8-1.fc13

Comment 7 Fedora Update System 2011-01-18 20:03:31 UTC
mock-1.0.15-1.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/mock-1.0.15-1.el5

Comment 8 Fedora Update System 2011-01-19 18:26:14 UTC
mock-1.0.15-1.el5 has been pushed to the Fedora EPEL 5 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update mock'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/mock-1.0.15-1.el5

Comment 9 Fedora Update System 2011-01-21 23:03:29 UTC
mock-1.1.8-1.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2011-02-20 02:25:40 UTC
mock-1.1.9-1.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/mock-1.1.9-1.fc13

Comment 11 Fedora Update System 2011-02-20 02:28:51 UTC
mock-1.0.16-1.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/mock-1.0.16-1.el5

Comment 12 Fedora Update System 2011-02-20 02:31:48 UTC
mock-1.1.9-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.1.9-1.el6

Comment 13 Fedora Update System 2011-02-20 02:34:40 UTC
mock-1.1.9-1.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/mock-1.1.9-1.fc14

Comment 14 Fedora Update System 2011-03-03 08:24:10 UTC
mock-1.1.9-1.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 15 Fedora Update System 2011-03-03 08:33:11 UTC
mock-1.1.9-1.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 16 Fedora Update System 2011-05-13 20:33:23 UTC
mock-1.1.10-1.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/mock-1.1.10-1.fc15

Comment 17 Fedora Update System 2011-05-13 20:38:13 UTC
mock-1.1.10-1.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/mock-1.1.10-1.fc14

Comment 18 Fedora Update System 2011-05-13 20:42:30 UTC
mock-1.0.17-1.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/mock-1.0.17-1.el5

Comment 19 Fedora Update System 2011-05-13 20:46:48 UTC
mock-1.1.10-1.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/mock-1.1.10-1.fc13

Comment 20 Fedora Update System 2011-05-13 20:51:01 UTC
mock-1.1.10-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.1.10-1.el6

Comment 21 Fedora Update System 2011-05-19 04:34:47 UTC
mock-1.1.10-1.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 22 Fedora Update System 2011-05-25 02:42:13 UTC
mock-1.1.10-1.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 23 Fedora Update System 2011-05-25 03:16:32 UTC
mock-1.1.10-1.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 24 Fedora Update System 2011-06-02 19:06:22 UTC
mock-1.0.17-1.el5 has been pushed to the Fedora EPEL 5 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 25 Fedora Update System 2011-06-02 19:16:23 UTC
mock-1.1.10-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.