Bug 1265915

Summary: idoverrideuser-find fails if any SID anchor is not resolvable anymore
Product: Red Hat Enterprise Linux 7 Reporter: Sudhir Menon <sumenon>
Component: ipaAssignee: IPA Maintainers <ipa-maint>
Status: CLOSED ERRATA QA Contact: Namita Soman <nsoman>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.2CC: ksiddiqu, mkosek, pvoborni, rcritten
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ipa-4.4.0-0.el7.1.alpha1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-04 05:46:53 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:

Description Sudhir Menon 2015-09-24 07:22:57 UTC
Description of problem: When AD trust is deleted post winsync migrate, the Default trust View is not listed in UI. 


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


How reproducible: Always.


Steps to Reproduce:
1. Establish Winsync Agreement with AD
2. Ensure users are replicated to IPA.
3. Now AD trust with POSIX i.e ipa trust-add --range-type='ipa-ad-trust-posix'
4. Ensure trust is established successfully
5. Ensure that the users are listed in 'Default Trust View'
6. Now delete the trust.

Actual results:
The trust gets removed successfully, but when we navigate to IDViews tab it displays the below error in UI

Operations Error:  invalid 'sid': SID is not valid
An error has occurred (IPA Error 3009: ValidationError)

Error on Console.
[root@ipa01 ipa]# ipa idoverrideuser-find "Default Trust View"
ipa: ERROR: invalid 'sid': SID is not valid


Expected results:
Should the ID Views be removed here? Default Trust View shouldn't be removed.
If they are to be removed, shouldn't we fix the error seen on the UI and console.

Additional info:

Comment 2 Tomas Babej 2015-09-24 08:58:03 UTC
Upstream ticket:
https://fedorahosted.org/freeipa/ticket/5322

Comment 3 Tomas Babej 2015-09-24 08:58:25 UTC
The "Default Trust View" should not be removed after the trust is deleted. However, the failure of idoverrideuser-find is a legitimate one, it should be able to cope with SIDs that are no longer resolvable.

Comment 4 Petr Vobornik 2015-10-19 20:51:48 UTC
master:
    4c2276f7ec9a049ea9088030b23badecd88c73e4 idoverride: Ignore ValidationErrors when converting the anchor
    eaeb40328cf80f615684ffc692b9416e1c08d544 tests: Add tests for idoverride object integrity 

ipa-4-2:
    52680a1a08a040b99e1a843126f5588e14237691 idoverride: Ignore ValidationErrors when converting the anchor
    cc085d240dc4c6a02ef39752043059c1d35b591a tests: Add tests for idoverride object integrity

Comment 5 Mike McCune 2016-03-28 22:43:24 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 7 Sudhir Menon 2016-07-21 07:18:22 UTC
Default Trust View is not removed.
Also the SID's are also handled which are no longer resolvable.

Fix is seen in ipa-server-4.4.0-2.1.el7.x86_64


[root@server ~]# ipa idoverrideuser-find
ID View Name: Default Trust View
---------------------------
5 User ID overrides matched
---------------------------
  Anchor to override: user1
  User login: user1
  UID: 1081400003
  GECOS: user1
  GID: 1081400003
  Login shell: /bin/sh

  Anchor to override: user2
  User login: user2
  UID: 1081400001
  GECOS: user2
  GID: 1081400001
  Login shell: /bin/sh

  Anchor to override: user3
  User login: user3
  UID: 1081400004
  GECOS: user3
  GID: 1081400004
  Login shell: /bin/sh

  Anchor to override: user4
  User login: user4
  UID: 1081400005
  GECOS: t
  GID: 1081400005
  Login shell: /bin/sh

  Anchor to override: user5
  User login: user5
  UID: 1081400006
  GECOS: user5
  GID: 1081400006
  Login shell: /bin/sh
----------------------------
Number of entries returned 5
----------------------------
[root@server ~]# ipa trust-del pne.qe
----------------------
Deleted trust "pne.qe"
----------------------
[root@server ~]# ipa idoverrideuser-find 'Default Trust View'
---------------------------
5 User ID overrides matched
---------------------------
  Anchor to override: :SID:S-1-5-21-3912719521-1967590360-1136226524-1403
  User login: user1
  UID: 1081400003
  GECOS: user1
  GID: 1081400003
  Login shell: /bin/sh

  Anchor to override: :SID:S-1-5-21-3912719521-1967590360-1136226524-1405
  User login: user2
  UID: 1081400001
  GECOS: user2
  GID: 1081400001
  Login shell: /bin/sh

  Anchor to override: :SID:S-1-5-21-3912719521-1967590360-1136226524-1413
  User login: user3
  UID: 1081400004
  GECOS: user3
  GID: 1081400004
  Login shell: /bin/sh

  Anchor to override: :SID:S-1-5-21-3912719521-1967590360-1136226524-1415
  User login: user4
  UID: 1081400005
  GECOS: t
  GID: 1081400005
  Login shell: /bin/sh

  Anchor to override: :SID:S-1-5-21-3912719521-1967590360-1136226524-1419
  User login: user5
  UID: 1081400006
  GECOS: user5
  GID: 1081400006
  Login shell: /bin/sh
----------------------------
Number of entries returned 5
----------------------------

Comment 9 errata-xmlrpc 2016-11-04 05:46:53 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-2404.html