Bug 670152 - mock fails on nested groups
Summary: mock fails on nested groups
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: mock
Version: 14
Hardware: Unspecified
OS: Linux
low
medium
Target Milestone: ---
Assignee: Clark Williams
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-01-17 11:29 UTC by Sandro
Modified: 2013-01-10 06:25 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-05-06 21:04:42 UTC
Type: ---


Attachments (Terms of Use)

Description Sandro 2011-01-17 11:29:53 UTC
Description of problem:

Mock fails to run if user is in a group that is member of group mock.

We are using ldap for account management and have a couple of servers on which groups of people are allowed to run mock builds. In the past it was sufficient to modify /etc/pam.d/mock and add some ACLs on /var/lib/mock.

In our setup user 'sandroj' is member of group 'sysadmin-terminal'. Group 'sysadmin-terminal' is member of the local group 'mock' on servers that are designated as build hosts.

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

mock-1.1.7-1.fc14.noarch

How reproducible:

Always

Steps to Reproduce:
1. run mock
2.
3.
  
Actual results:

ERROR: Must be member of 'mock' group to run mock! (['sysadmin-main', 'OGD', 'svn-terminal', 'puppet-masters', 'sysadmin-terminal', 'PLAP-Admin', 'sysadmin-zarafa', 'sysadmin-test', 'sysadmin-www', 'git-terminal-codebase', 'sysadmin-mirror'])
Traceback (most recent call last):
  File "/usr/sbin/mock", line 445, in <module>
    def do_buildsrpm(config_opts, chroot, options, args):
  File "/usr/sbin/mock", line 539, in main
    groupcheck()
  File "/usr/sbin/mock", line 496, in groupcheck
    raise RuntimeError, "Must be member of 'mock' group to run mock! (%s)" % members
RuntimeError: Must be member of 'mock' group to run mock! (['sysadmin-main', 'OGD', 'svn-terminal', 'puppet-masters', 'sysadmin-terminal', 'PLAP-Admin', 'sysadmin-zarafa', 'sysadmin-test', 'sysadmin-www', 'git-terminal-codebase', 'sysadmin-mirror'])

Expected results:

Well, mock not complaining.

Additional info:

Mock should be able to deal with nested groups by querying members of group mock instead of the grouplist of the user running mock. 'getent mock' on the affected system returns all members of group mock. This list could then be checked against the user running mock.

Comment 1 Sandro 2011-01-17 11:56:55 UTC
I spoke too soon. 'getent mock' only returns the members as listed in '/etc/group':

mock:x:489:@sysadmin-main,@sysadmin-terminal

'sysadmin-main' and 'sysadmin-terminal' being the groups that are allowed to run mock.

Sorry, for the confusion.

Comment 2 Fedora Admin XMLRPC Client 2011-03-11 18:10:26 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.


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