Bug 1583251

Summary: home dir disappear in sssd cache on the IPA master for AD users
Product: Red Hat Enterprise Linux 7 Reporter: Sebastien Aime <saime>
Component: sssdAssignee: Sumit Bose <sbose>
Status: CLOSED ERRATA QA Contact: ipa-qe <ipa-qe>
Severity: high Docs Contact:
Priority: high    
Version: 7.5CC: amore, fidencio, grajaiya, jhrozek, ksiddiqu, lslebodn, mkosek, mzidek, pbrezina, saime, sbose, sgoveas, tscherf
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: sssd-1.16.2-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1596292 (view as bug list) Environment:
Last Closed: 2018-10-30 10:42:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1596292    

Description Sebastien Aime 2018-05-28 14:58:31 UTC
Following an update to RHEL7.5, AD users home directory is set to '/'.
For example:

getent passwd <user>@<AD domain>
<user>@<AD domain>:*:988808870:988808870:<user name>:/:/bin/bash

Rebooting the IdM server fixes the issue, but it comes back after a while.

Comment 3 Sumit Bose 2018-05-29 13:06:08 UTC
This issue is related to the magic private group (mpg) code which makes sure that with algorithmic id-mapping users from AD (sub-domain users) are automatically assigned a user private group. Since the private groups does not exists as a real group a lookup for this group uses a fallback to a user lookup.

If now the user private group is looked up while the cached user entry is exprired the backend first tries to find a matching group fails and falls back to a user lookup. Now two issues happen. First the user is looked up in the Global Catalog which will remove attribute from the cache which are not replicated to the Global Catalog, e.g. the shell or a home directory defined in AD. Second the code which adds the home directory attribute to the cache user object was not able to find the user object because the original request was a group lookup and the used call to search the cache was not aware of MPGs.

Reproducer:

[root@f26-ipa ~]# systemctl stop sssd.service ; rm -f /var/log/sssd/* ; rm -f /var/lib/sss/db/* ; systemctl start sssd.service                                                                                                                
[root@f26-ipa ~]# getent passwd tu1                                                                                                                                                                                                  
tu1:*:1367201104:1367201104:t u:/home/ad.devel/tu1:/bin/sh                                                                                                                                                                           
[root@f26-ipa ~]# sss_cache -E                                                                                                                                                                                                                
[root@f26-ipa ~]# getent group 1367201104                                                                                                                                                                                              
tu1:*:1367201104:                                                                                                                                                                                                                    
[root@f26-ipa ~]# getent passwd tu1                                                                                                                                                                                                  
tu1:*:1367201104:1367201104:t u:/:

Comment 4 Sumit Bose 2018-05-29 13:19:12 UTC
Upstream ticket:
https://pagure.io/SSSD/sssd/issue/3748

Comment 5 Jakub Hrozek 2018-06-08 13:44:30 UTC
 * master:
  * ad6ab35
  * e66517d
  * 0322215
  * 8aa56a9

Comment 6 Jakub Hrozek 2018-06-08 13:45:08 UTC
Kaleem, could you qa_ack this bug, please? See comment #3 for a reproducer.

Comment 22 errata-xmlrpc 2018-10-30 10:42:30 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:3158