Bug 1304992 - Handle overriden name of members in the memberUid attribute [NEEDINFO]
Handle overriden name of members in the memberUid attribute
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: sssd (Show other bugs)
7.3
All Linux
high Severity high
: rc
: ---
Assigned To: SSSD Maintainers
Steeve Goveas
:
Depends On: 1366569
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-05 04:16 EST by Jakub Hrozek
Modified: 2016-11-04 03:15 EDT (History)
11 users (show)

See Also:
Fixed In Version: sssd-1.14.0-14.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-11-04 03:15:50 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
sumenon: needinfo? (jhrozek)


Attachments (Terms of Use)
sssd log (24.82 KB, text/plain)
2016-08-12 02:28 EDT, Sudhir Menon
no flags Details
sssd domain log (222.46 KB, text/plain)
2016-08-12 02:28 EDT, Sudhir Menon
no flags Details
sssd nsss log (19.72 KB, text/plain)
2016-08-12 02:29 EDT, Sudhir Menon
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
FedoraHosted SSSD 2948 None None None 2016-07-06 16:53 EDT

  None (edit)
Description Jakub Hrozek 2016-02-05 04:16:16 EST
This bug is created as a clone of upstream ticket:
https://fedorahosted.org/sssd/ticket/2948

Currently when AD user's name is overriden in the default trust view, then getgr* requests still report the original name:
{{{
$ getent passwd administrator@win.trust.test
admin_from_parent@win.trust.test:*:962400500:962400500:Administrator:/home/win.trust.test/administrator:
$ getent group admins@win.trust.test
admins@win.trust.test:*:962410634:administrator@win.trust.test
}}}

This is because the memberUid attribute is generated when the user is added, before the overrides are applied. We need to rename the entry when the login override is applied because the memberUid is only generated based on the name user's attribute.
Comment 1 Jakub Hrozek 2016-06-27 04:48:33 EDT
Upstream didn't completely fix this bug and since there is no downstream customer case attached, I think it's fine to wait until 7.4
Comment 8 Jakub Hrozek 2016-07-29 09:10:37 EDT
* master:
    * f2e8a7c3230fac11175c0bd17c14c66a8e9b25ad
    * 160ba891ec483c5b7d2a3fcca5bd992fc790efe0
    * 17bfd9f69251781140e4b2b55ffeb649d7a79e86
    * 1594701fbdc341069e11cff9a85e7a795e52db3d
Comment 10 Sudhir Menon 2016-08-12 02:27:32 EDT
Tested using 
sssd-1.14.0-18.el7.x86_64 
ipa-server-4.4.0-7.el7.x86_64

Observations:
Although the id command displays the overridden login name , but getent group returns the actual user name e.g test2 instead of test22.
Attaching the sssd logs for the test.

Verified using the below steps
1. Create trust with windows AD.
2. User test2 is a member of sales group in Windows AD
3. now run id command on ipa-server

[root@master sssd]# id test2@pne.qe
uid=558001486(test2@pne.qe) gid=558001486(test2@pne.qe) groups=558001486(test2@pne.qe)

[root@master sssd]# getent passwd test2@pne.qe
test2@pne.qe:*:558001486:558001486:test2:/home/pne.qe/test2:

[root@master sssd]# ipa idview-find
-----------------
1 ID View matched
-----------------
  ID View Name: Default Trust View
  Description: Default Trust View for AD users. Should not be deleted.
----------------------------
Number of entries returned 1
----------------------------

[root@master sssd]# ipa idoverrideuser-add 
ID View Name: Default Trust View
Anchor to override: test2@pne.qe
-------------------------------------
Added User ID override "test2@pne.qe"
-------------------------------------
  Anchor to override: test2@pne.qe

[root@master sssd]# ipa idoverrideuser-mod --login=test22 
ID View Name: Default trust view
Anchor to override: test2@pne.qe
-------------------------------------------
Modified an User ID override "test2@pne.qe"
-------------------------------------------
  Anchor to override: test2@pne.qe
  User login: test22

[root@master sssd]# getent passwd test2@pne.qe
test22@pne.qe:*:558001486:558001486:test2:/home/pne.qe/test2:

[root@master sssd]# getent group sales@pne.qe
sales@pne.qe:*:558001488:test2@pne.qe
Comment 11 Sudhir Menon 2016-08-12 02:28 EDT
Created attachment 1190268 [details]
sssd log
Comment 12 Sudhir Menon 2016-08-12 02:28 EDT
Created attachment 1190269 [details]
sssd domain log
Comment 13 Sudhir Menon 2016-08-12 02:29 EDT
Created attachment 1190270 [details]
sssd nsss log
Comment 14 Sudhir Menon 2016-08-12 02:46:09 EDT
Found that the getent group on master/client show different result.

Please note that 'service sssd stop ; rm -frv /var/lib/sss/{db,mc}/* ; service sssd start' was run on both master and client machines before running the command.

[root@master sssd]# getent group sales@pne.qe
sales@pne.qe:*:558001488:test2@pne.qe

[root@client ~]# getent group sales@pne.qe
sales@pne.qe:*:558001488:test22@pne.qe
Comment 15 Sudhir Menon 2016-08-12 08:25:28 EDT
Note:
After manually adding sss as lookup in nsswitch.conf file against initgroups, the correct results are shown.

===IPA Server===
[root@ipaserver sssd]# grep initgroups /etc/nsswitch.conf
initgroups: files sss

[root@ipaserver sssd]# id test2@pne.qe
uid=558001486(test22@pne.qe) gid=558001486(test22@pne.qe) groups=558001486(test22@pne.qe),558000513(domain users@pne.qe),558001488(sales@pne.qe)

[root@ipaserver sssd]# getent group sales@pne.qe
sales@pne.qe:*:558001488:test22@pne.qe

===IPA Client===
[root@client ~]# sss_cache -E
[root@client ~]# id test2@pne.qe
uid=558001486(test22@pne.qe) gid=558001486(test22@pne.qe) groups=558001486(test22@pne.qe),558000513(domain users@pne.qe),558001488(sales@pne.qe)
[root@client ~]# getent group sales@pne.qe
sales@pne.qe:*:558001488:test22@pne.qe
Comment 16 Lukas Slebodnik 2016-08-12 09:04:09 EDT
(In reply to Sudhir Menon from comment #15)
> Note:
> After manually adding sss as lookup in nsswitch.conf file against
> initgroups, the correct results are shown.
> 
It is not expected to changes nsswitch.conf
The line for initgroups is commented out as part of "authconfig --enablesssd --update"

ipa-client-install and realmd uses authconfig underneath.
So the nsswitch.conf should be properly configured
Comment 17 Sudhir Menon 2016-08-12 09:10:53 EDT
Lukas,
You meant to say that the fix is needed in authconfig and we shouldn't be making any changes in /etc/nsswitch.conf, right?
Comment 18 Lukas Slebodnik 2016-08-12 09:41:21 EDT
(In reply to Sudhir Menon from comment #17)
> Lukas,
> You meant to say that the fix is needed in authconfig and we shouldn't be
> making any changes in /etc/nsswitch.conf, right?

You can test authconfig with following steps

[root@b29b086114f1 /]# grep initgroups /etc/nsswitch.conf
initgroups: files

[root@b29b086114f1 /]# authconfig --enablesssd --update
[root@b29b086114f1 /]# 
[root@b29b086114f1 /]# grep initgroups /etc/nsswitch.conf
#initgroups: files

If result is not the same then it's bug in authconfig.
otherwise there is a bug in ipa-{server,client}-install
Comment 19 Sudhir Menon 2016-08-12 09:43:03 EDT
[root@ipaserver sssd]# grep initgroups /etc/nsswitch.conf
initgroups: files
[root@ipaserver sssd]# authconfig --enablesssd --update
[root@ipaserver sssd]# grep initgroups /etc/nsswitch.conf
initgroups: files
Comment 20 Jakub Hrozek 2016-08-12 09:44:41 EDT
(In reply to Lukas Slebodnik from comment #16)
> (In reply to Sudhir Menon from comment #15)
> > Note:
> > After manually adding sss as lookup in nsswitch.conf file against
> > initgroups, the correct results are shown.
> > 
> It is not expected to changes nsswitch.conf
> The line for initgroups is commented out as part of "authconfig --enablesssd
> --update"
> 
> ipa-client-install and realmd uses authconfig underneath.
> So the nsswitch.conf should be properly configured

Please see https://bugzilla.redhat.com/show_bug.cgi?id=1366569
Comment 21 Sudhir Menon 2016-08-16 05:51:32 EDT
Since there is already #bz1366569 to address the issue related to sss entry against initgroups in nsswitch.conf file. Marking the bug Verified as per comment #15.

Verified using 
sssd-1.14.0-18.el7.x86_64
ipa-server-4.4.0-7.el7.x86_64
Comment 23 errata-xmlrpc 2016-11-04 03:15:50 EDT
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://rhn.redhat.com/errata/RHEA-2016-2476.html

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