Description of problem: There are a few different problems here which combine to cause some very weird behaviour... Version-Release number of selected component (if applicable): mock-1.1.41-1.fc20.noarch How reproducible: easily Steps to Reproduce: 1. Make an unprivileged user account in the mock group 2. From a root shell, run: su myuser (note that I omitted the - option to start a login shell) 3. Run any mock commands, for example: mock -r fedora-19-x86_64 --init Actual results: OSError: [Errno 0] Success ERROR: Error in configuration Expected results: mock should work Additional info: First I had to comment out the traceback printing stuff in update_config_from_file in util.py line 765, which doesn't seem to work. So then I got an actual traceback: Traceback (most recent call last): File "/usr/sbin/mock", line 306, in <module> def do_buildsrpm(config_opts, chroot, options, args): File "/usr/sbin/mock", line 424, in main mockbuild.util.update_config_from_file(config_opts, cfg, uidManager) File "/usr/lib/python2.7/site-packages/mockbuild/util.py", line 735, in update_config_from_file uidManager.dropPrivsForever() File "<peak.util.decorators.rewrap wrapping mockbuild.uid.dropPrivsForever at 0x01BB2CF8>", line 3, in dropPrivsForever File "/usr/lib/python2.7/site-packages/mockbuild/trace_decorator.py", line 70, in trace result = func(*args, **kw) File "/usr/lib/python2.7/site-packages/mockbuild/uid.py", line 45, in dropPrivsForever self._elevatePrivs() File "<peak.util.decorators.rewrap wrapping mockbuild.uid._elevatePrivs at 0x01BB15F0>", line 3, in _elevatePrivs File "/usr/lib/python2.7/site-packages/mockbuild/trace_decorator.py", line 70, in trace result = func(*args, **kw) File "/usr/lib/python2.7/site-packages/mockbuild/uid.py", line 61, in _elevatePrivs setresuid(0, 0, 0) File "/usr/lib/python2.7/site-packages/mockbuild/uid.py", line 100, in setresuid raise OSError(ctypes.get_errno(), os.strerror(ctypes.get_errno())) OSError: [Errno 0] Success ERROR: Error in configuration So next I can see that for the privilege escalation/dropping stuff it is calling setresuid(0, 0, 0) which is apparently failing but the errno is not being set. That's because the ctypes library handle does not have use_errno=True which means the ctypes.get_errno() function does not work. That can be fixed by changing uid.py line 83 to: _libc = ctypes.CDLL(None, use_errno=True) Now I get the real error, and mock helpfully has an explanation of what I was doing wrong: ERROR: [Errno 1] Operation not permitted ERROR: The most common cause for this error is trying to run /usr/sbin/mock as an unprivileged user. ERROR: Check your path to make sure that /usr/bin/ is listed before /usr/sbin, or manually run /usr/bin/mock to see if that fixes this problem.
This should be already fixed upstream in commit b58757c
I'm not sure if it's related, but I'm getting same error. --verbose option doesn't do anything... [packager@d131a8d6e5c0 ~]$ rpm -q mock mock-1.1.41-3.fc20.noarch [packager@d131a8d6e5c0 ~]$ id uid=1000(packager) gid=1000(packager) groups=1000(packager),10(wheel),135(mock) [packager@d131a8d6e5c0 ~]$ mock -r fedora-20-x86_64 --init OSError: [Errno 0] Success ERROR: Error in configuration [packager@d131a8d6e5c0 ~]$ sudo mock -r fedora-20-x86_64 --init INFO: mock.py version 1.1.41 starting... Start: init plugins INFO: selinux disabled Finish: init plugins Start: run ERROR: Namespace unshare failed.
That's seems like a separate issue. Please fill a new bug and attach output of sudo strace -e unshare mock -r fedora-20-x86_64 --init and include your kernel version (and whether it's custom)
Fixed in mock-1.2.0, which just landed in rawhide.
Any chance you of this fix being backported to F20? Thanks.
Once we will be confident that it is stable enough. For reasoning see: http://miroslav.suchy.cz/blog/archives/2014/10/12/big_changes_in_mock/index.html