Bug 468810 - Permission denied: '/var/lib/mock//fedora-rawhide-i386/result
Permission denied: '/var/lib/mock//fedora-rawhide-i386/result
Product: Fedora
Classification: Fedora
Component: mock (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: David Cantrell
Fedora Extras Quality Assurance
: Reopened
Depends On:
  Show dependency treegraph
Reported: 2008-10-28 01:48 EDT by Ralf Corsepius
Modified: 2013-01-09 23:52 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-07-27 14:43:47 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
patch to catch exception and print friendly error. (2.43 KB, patch)
2008-11-18 18:32 EST, Michael E Brown
no flags Details | Diff

  None (edit)
Description Ralf Corsepius 2008-10-28 01:48:56 EDT
Description of problem:

# mock -r fedora-rawhide-i386 init
You are attempting to run "mock" which requires administrative
privileges, but more information is needed in order to do so.
Authenticating as "root"
INFO: mock.py version 0.9.12 starting...
State Changed: init plugins
State Changed: start
State Changed: lock buildroot
State Changed: clean
State Changed: init
ERROR: Could not create dir /var/lib/mock//fedora-rawhide-i386/result. Error: [Errno 13] Permission denied: '/var/lib/mock//fedora-rawhide-i386/result'
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/mock/util.py", line 62, in mkdirIfAbsent
  File "/usr/lib/python2.5/os.py", line 171, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/var/lib/mock//fedora-rawhide-i386/result'
ERROR: Could not create dir /var/lib/mock//fedora-rawhide-i386/result. Error: [Errno 13] Permission denied: '/var/lib/mock//fedora-rawhide-i386/result'

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. make sure user is not in group "mock"
2. run "mock -r fedora-rawhide-i386 init"

Actual results:
c.f. above.

Expected results:
Function. IMO, mock should either work without any complaint or to refuse working with a clear messages.

That said, IMO this behavior is multiply broken:
* this interactive "login as root" is silly. mock should abort with a proper error message if something (permissions) doesn't fit.
* letting users run into tracebacks is dirty coding (== bug). mock should abort with a proper error message, if something doesn't fit.
* As mock requires special privileges and is not "runable by arbitrary users", mock should be moved to /usr/sbin.
Comment 1 Michael E Brown 2008-11-18 18:31:31 EST
use --resultdir= to put the build products elsewhere, and everything will work ok.
Comment 2 Michael E Brown 2008-11-18 18:32:55 EST
Created attachment 323981 [details]
patch to catch exception and print friendly error.
Comment 3 Bug Zapper 2008-11-25 23:21:02 EST
This bug appears to have been reported against 'rawhide' during the Fedora 10 development cycle.
Changing version to '10'.

More information and reason for this action is here:
Comment 4 Jesse Keating 2009-02-05 19:00:00 EST
This was built for rawhide.
Comment 5 Amit Shah 2010-02-24 10:05:24 EST
This behaviour still persists with mock in F12.

Note You need to log in before you can comment on or make changes to this bug.