Bug 1277576

Summary: duplicate ldap entries returned on getent when making usage of ID views in IPA
Product: Red Hat Enterprise Linux 7 Reporter: Luc de Louw <ldelouw>
Component: slapi-nisAssignee: Alexander Bokovoy <abokovoy>
Status: CLOSED ERRATA QA Contact: Namita Soman <nsoman>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 7.2CC: ekeck, gagriogi, jkurik, ksiddiqu, ldelouw, mkosek, sumenon
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1281750 (view as bug list) Environment:
Last Closed: 2016-11-04 07:05:09 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: 1281750    

Description Luc de Louw 2015-11-03 15:02:19 UTC
Description of problem:

when creating an ID view in IPA and override one or more users credentials such as UID, GID, Shell etc.


Version-Release number of selected component (if applicable):
slapi-nis-0.54-3.el7_1.x86_64


How reproducible:
Always


Steps to Reproduce:
1. Install IPA
2. Add a user: ipa user-add --first=Joe --last=Doe --shell=/bin/bash jdoe
3. Add idview: ipa idview-add legacy-servers --desc "Our legacy servers"
4. Map user: ipa idoverrideuser-add --uid=1001 --shell=/bin/ksh legacy-servers jdoe
5. Configure client to use the ID view via LDAP
authconfig --updateall --enableldap --enableldapauth --ldapserver=ldap://ipa3.example.com --ldapbasedn=cn=users,cn=legacy-servers,cn=views,cn=compat,dc=example,dc=com
6. getent passwd jdoe returns
uid=936200001(jdoe) gid=936200001 groups=936200001
7. Issue an ldapsearch:
ldapsearch -LLL -x -b cn=users,cn=legacy-servers,cn=views,cn=compat,dc=example,dc=com -D "cn=Directory Manager" -W uid=jdoe
Enter LDAP Password: 
dn: uid=jdoe,cn=users,cn=legacy-servers,cn=views,cn=compat,dc=example,dc=com
cn: Joe Doe
objectClass: posixAccount
objectClass: top
gidNumber: 936200001
gecos: Joe Doe
uidNumber: 936200001
uidNumber: 1001
loginShell: /bin/bash
loginShell: /bin/ksh
homeDirectory: /home/jdoe
uid: jdoe


Actual results:
The mapped attributes are not a unique answer but duplicated with the original entries.


Expected results:
getent passwd and others should return only the mapped attributes


Additional info:
With sssd it works as expected, but LDAP access to ID views are critical for Linux Systems with no SSSD and Legacy Unix Systems such as AIX, Solaris and others.g

Comment 16 Sudhir Menon 2016-08-04 11:31:32 UTC
Fix is seen.
Verified on RHEL7.3 using the below rpm.

ipa-server-4.4.0-4.el7.x86_64
ipa-client-4.4.0-4.el7.x86_64
slapi-nis-0.56.0-3.el7.x86_64

[root@vm92 ~]# ipa user-add --first=Joe --last=Doe --shell=/bin/bash jdoe
-----------------
Added user "jdoe"
-----------------
  User login: jdoe
  First name: Joe
  Last name: Doe
  Full name: Joe Doe
  Display name: Joe Doe
  Initials: JD
  Home directory: /home/jdoe
  GECOS: Joe Doe
  Login shell: /bin/bash
  Principal name: jdoe
  Principal alias: jdoe
  Email address: jdoe
  UID: 631400006
  GID: 631400006
  Password: False
  Member of groups: ipausers
  Kerberos keys available: False
[root@vm92 ~]# ipa idview-add legacy-servers --desc "Our legacy servers"
------------------------------
Added ID View "legacy-servers"
------------------------------
  ID View Name: legacy-servers
  Description: Our legacy servers
[root@vm92 ~]# ipa idoverrideuser-add --uid=1001 --shell=/bin/ksh legacy-servers jdoe
-----------------------------
Added User ID override "jdoe"
-----------------------------
  Anchor to override: jdoe
  UID: 1001
  Login shell: /bin/ksh

[root@client ~]# getent passwd jdoe returns
jdoe:*:1001:631400006:Joe Doe:/home/jdoe:/bin/ksh

[root@client ~]# authconfig --updateall --enableldap --enableldapauth --ldapserver=ldap://vm92.testrelm.test --ldapbasedn=cn=users,cn=legacy-servers,cn=views,cn=compat,dc=testrelm,dc=test
[root@client ~]# getent passwd jdoe returns
jdoe:*:1001:631400006:Joe Doe:/home/jdoe:/bin/ksh
[root@client ~]# ldapsearch -LLL -x -b cn=users,cn=legacy-servers,cn=views,cn=compat,dc=testrelm,dc=test -D "cn=Directory Manager" -W uid=jdoe
Enter LDAP Password: 
dn: uid=jdoe,cn=users,cn=legacy-servers,cn=views,cn=compat,dc=testrelm,dc=test
cn: Joe Doe
objectClass: posixAccount
objectClass: top
gidNumber: 631400006
gecos: Joe Doe
homeDirectory: /home/jdoe
uid: jdoe
loginShell: /bin/ksh
uidNumber: 1001

Comment 18 errata-xmlrpc 2016-11-04 07:05:09 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://rhn.redhat.com/errata/RHBA-2016-2471.html