Bug 670804

Summary: Nested groups are not unrolled during the first enumeration.
Product: Red Hat Enterprise Linux 6 Reporter: Gowrishankar Rajaiyan <grajaiya>
Component: sssdAssignee: Stephen Gallagher <sgallagh>
Status: CLOSED ERRATA QA Contact: Chandrasekar Kannan <ckannan>
Severity: medium Docs Contact:
Priority: low    
Version: 6.1CC: benl, dpal, grajaiya, jgalipea, prc
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: sssd-1.5.1-1.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-19 11:42:27 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:
Description Flags
Complete sssd_LDAP.log none

Description Gowrishankar Rajaiyan 2011-01-19 12:55:12 UTC
Created attachment 474249 [details]
Complete sssd_LDAP.log

Description of problem:
Nested groups are not unrolled during the first enumeration causing authentication of the users in nested group to fail, however authentication succeeds after the second enumeration.

Version-Release number of selected component (if applicable):
sssd-1.5.0-2.el6.x86_64

How reproducible:
Always

Steps to Reproduce:
DS setup:
1. Server setup: (make sure all users have primary group defined)
   SimpleGroup1 => simpleUserA simpleUserB simpleGroup3
   SimpleGroup2 => simpleUserC simpleUserD
   SimpleGroup3 => simpleUserE

2. Configure SSSD with "enumerate = true". See additional info for relevant
configuration.

3. restart sssd clearing cache.

4. Try authenticating with simpleuserE (which is a memberOf simplegroup3 which is a memberOf simplegroup1)
  
Actual results:
Authentication fails initially and succeeds after the second enumeration. 

Expected results:
Authentication should succeed after the first enumeration.

Additional info:
1. Relevant sssd configuration:
[domain/LDAP]
id_provider = ldap
auth_provider = ldap
ldap_uri = ldaps://rhdsserver.redhat.com:636
ldap_search_base = dc=example,dc=com
ldap_tls_reqcert = demand
ldap_tls_cacertdir = /etc/openldap/cacerts
ldap_tls_cacert = /etc/openldap/cacerts/cacert.asc
ldap_schema = rfc2307bis

cache_credentials = true
enumerate = true
debug_level = 9

access_provider = simple
simple_allow_groups = simplegroup1

Comment 1 Stephen Gallagher 2011-01-19 13:07:51 UTC
Currently our enumeration logic makes two passes: In the first pass, it creates all of the users in the cache. In the second pass, it creates all of the groups.

We need to split the second pass into a second and third pass, so that we have:
Pass 1: Create users
Pass 2: Create empty groups
Pass 3: Populate group members

The reason some nested groups were not unrolled is that the order of their creation would matter. If they weren't already in the sysdb when another group wanted to add them as a member, they would be overlooked.

Comment 2 Stephen Gallagher 2011-01-19 14:01:13 UTC
Tracking this issue upstream at https://fedorahosted.org/sssd/ticket/779

Comment 4 Gowrishankar Rajaiyan 2011-04-12 12:16:51 UTC
DS setup:
1. Server setup: (make sure all users have primary group defined)
   SimpleGroup1 => simpleUserA simpleUserB simpleGroup3
   SimpleGroup2 => simpleUserC simpleUserD
   SimpleGroup3 => simpleUserE


On Client:
# getent passwd simpleuserE
simpleuserE:*:8005:8005:simpleuserE:/home/simpleuserE:/bin/bash

# id -G -n simpleuserE
simplegroupE simplegroup3 simplegroup1

# ssh -l simpleuserE localhost
simpleuserE@localhost's password: 
Creating directory '/home/simpleuserE'.
[simpleuserE@rhel6-1 ~]$ 

Verified. 
# rpm -qi sssd | head 
Name        : sssd                         Relocations: (not relocatable)
Version     : 1.5.1                             Vendor: Red Hat, Inc.
Release     : 26.el6                        Build Date: Tue 12 Apr 2011 01:49:31 AM IST
Install Date: Tue 12 Apr 2011 02:29:09 PM IST      Build Host: x86-005.build.bos.redhat.com
Group       : Applications/System           Source RPM: sssd-1.5.1-26.el6.src.rpm
Size        : 3462772                          License: GPLv3+
Signature   : (none)
Packager    : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
URL         : http://fedorahosted.org/sssd/
Summary     : System Security Services Daemon

Comment 5 errata-xmlrpc 2011-05-19 11:42:27 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0560.html

Comment 6 errata-xmlrpc 2011-05-19 13:09:19 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0560.html