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 642051
Summary: | Xvfb SELinux issues in mock | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Orion Poplawski <orion> |
Component: | mock | Assignee: | Clark Williams <williams> |
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | medium | Docs Contact: | |
Priority: | low | ||
Version: | 14 | CC: | dcantrell, dwalsh, mebrown, paul, williams, xgl-maint |
Target Milestone: | --- | Keywords: | Reopened, SELinux |
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | mock-1.1.10-1.el6 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2011-03-03 08:28:48 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: |
Description
Orion Poplawski
2010-10-11 21:09:44 UTC
I believe this is supposed to be fixed in F14 I am not sure mock was fixed in F13, to not put down labels. Updated my mock machine to F14 and still get: _XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created. Fatal server error: SELinux: Failed to open x_contexts mapping in policy Orion, are you loading the SELinux plugin? If you're running SELinux on your build machine, then you need to. If you're loading it and you're getting SELinux problems, then we have a bug. Is this what you mean? # semodule -l | grep mock mock 1.0.0 No, there's an selinux plugin in mock now. It should load by default, detect that the host system is running selinux in enforcing or permissive mode then bind mount a fake /proc/filesystems file in the chroot so that running things like sestatus in the chroot will return disabled. you should see a print at the start of the run that says: INFO: selinux enabled or INFO: selinux disabled when the plugin initializes. This tells if the host system is running SELinux INFO: mock.py version 1.1.5 starting... State Changed: init plugins INFO: selinux enabled There's a problem with the SELinux plugin in mock 1.1.5 in that it uses mkstemp() to create the dummy /proc/filesystems file and hence it's created with mode 0600, i.e. unreadable to processes running as user mockbuild in the chroot. This causes some versions of libselinux (including F-13 and RHEL-6 Beta) to return -1 for is_selinux_enabled(), which some users if teh library (e.g. openssh) treat as "enabled". Simple fix is to fix the mode of the file to be 0444 like the real /proc/filesystems: --- /usr/lib/python2.6/site-packages/mock/plugins/selinux.py.orig 2010-09-17 23:15:23.000000000 +0100 +++ /usr/lib/python2.6/site-packages/mock/plugins/selinux.py 2010-10-14 11:04:56.906097982 +0100 @@ -58,6 +58,7 @@ os.close(self.fd) host.close() + os.chmod(self.filesystems, 0444) self.rootObj.mountCmds.append("mount -n --bind %s %s" % (self.filesystems, self.chrootFilesystems)) self.rootObj.umountCmds.append("umount -n %s" % self.chrootFilesystems) Yes there is a another bug on Mock with the same solution. Argh, I've had the fix Paul mentions in my tree for a while now, just got caught up in other stuff. I'll push out a new mock later today which should fix the issue. Orion, would you try the mock-1.1.6 build in koji: https://koji.fedoraproject.org/koji/buildinfo?buildID=200570 and let me know if that clears up the SELinux permission problem? mock-1.1.6-1.fc13 has been submitted as an update for Fedora 13. https://admin.fedoraproject.org/updates/mock-1.1.6-1.fc13 mock-1.1.6-1.fc14 has been submitted as an update for Fedora 14. https://admin.fedoraproject.org/updates/mock-1.1.6-1.fc14 mock-1.0.13-1.el5 has been submitted as an update for Fedora EPEL 5. https://admin.fedoraproject.org/updates/mock-1.0.13-1.el5 mock-1.0.13-1.fc12 has been submitted as an update for Fedora 12. https://admin.fedoraproject.org/updates/mock-1.0.13-1.fc12 Fixes it for me. Thanks! \o/ Pushed to testing mock-1.1.6-1.fc13 has been pushed to the Fedora 13 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.1.6-1.fc13 mock-1.1.6-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.6-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.0.14-1.el5 has been submitted as an update for Fedora EPEL 5. https://admin.fedoraproject.org/updates/mock-1.0.14-1.el5 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 I'm going to reopen this because I seem to see the same problem when I run mock --shell, which is impacting my ability to troubleshoot a build failure. mock-1.1.8-1.fc14.noarch so when you run --shell, what's failing? The Xvfb server doesn't start with: Fatal server error: SELinux: Failed to open x_contexts mapping in policy 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.0.16-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.16-1.el5 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. |