Bug 663021 - [PATCH] Don't add --setopt=tsflags=nocontexts to all commands
[PATCH] Don't add --setopt=tsflags=nocontexts to all commands
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: mock (Show other bugs)
14
Unspecified Unspecified
low Severity medium
: ---
: ---
Assigned To: David Cantrell
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-12-14 08:19 EST by Paul Howarth
Modified: 2013-01-10 01:23 EST (History)
5 users (show)

See Also:
Fixed In Version: mock-1.1.10-1.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-01-21 18:04:14 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


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

  None (edit)
Description Paul Howarth 2010-12-14 08:19:15 EST
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 11:58:36 EST
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 10:18:54 EST
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 10:31:33 EST
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 13:02:29 EST
Any chance mock 1.1.8 can get pushed?  It seems to work fine.
Comment 5 Fedora Update System 2011-01-18 14:57:57 EST
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 14:58:37 EST
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 15:03:31 EST
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 13:26:14 EST
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 18:03:29 EST
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-19 21:25:40 EST
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-19 21:28:51 EST
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-19 21:31:48 EST
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-19 21:34:40 EST
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 03:24:10 EST
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 03:33:11 EST
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 16:33:23 EDT
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 16:38:13 EDT
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 16:42:30 EDT
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 16:46:48 EDT
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 16:51:01 EDT
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 00:34:47 EDT
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-24 22:42:13 EDT
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-24 23:16:32 EDT
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 15:06:22 EDT
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 15:16:23 EDT
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.