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
Summary: | [PATCH] Don't add --setopt=tsflags=nocontexts to all commands | ||||||
---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Paul Howarth <paul> | ||||
Component: | mock | Assignee: | David Cantrell <dcantrell> | ||||
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
Severity: | medium | Docs Contact: | |||||
Priority: | low | ||||||
Version: | 14 | CC: | dcantrell, gholms, mebrown, rhbugs, williams | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Whiteboard: | |||||||
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 23:04:14 UTC | Type: | --- | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Thanks Paul, yeah I missed it on buildsys-list. I've pulled this in and will add it to mock-1.1.8. 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. 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. Any chance mock 1.1.8 can get pushed? It seems to work fine. 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 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 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 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 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. 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 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 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 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 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. 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. 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 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 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 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 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 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. 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. 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. 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. 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. |
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.