RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1056120 - ipasam does not support deleting multiple child trusted domains due to LDAP delete operation
Summary: ipasam does not support deleting multiple child trusted domains due to LDAP d...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: ipa
Version: 7.0
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: rc
: ---
Assignee: Martin Kosek
QA Contact: Namita Soman
URL:
Whiteboard:
Depends On:
Blocks: 1110664
TreeView+ depends on / blocked
 
Reported: 2014-01-21 14:30 UTC by Dmitri Pal
Modified: 2015-09-23 14:32 UTC (History)
3 users (show)

Fixed In Version: ipa-3.3.3-13.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1110664 (view as bug list)
Environment:
Last Closed: 2014-06-13 11:19:01 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Dmitri Pal 2014-01-21 14:30:01 UTC
This bug is created as a clone of upstream ticket:
https://fedorahosted.org/freeipa/ticket/4126

ipasam needs to change to delete first all child domains and then remove the trusted domain because LDAP API does not support deleting non-leaf entries.

Comment 1 Martin Kosek 2014-01-21 16:23:42 UTC
Fixed upstream:

master: c29211671cfd7d7734b932c8d6d70c94c849b5d1
ipa-3-3: 897e1415ce1b711cd7179fa973569969236984ed

Comment 2 Namita Soman 2014-01-21 16:31:12 UTC
Please add steps to verify

Comment 3 Alexander Bokovoy 2014-01-21 19:25:05 UTC
Steps to verify:
1. Install IPA from scratch

2. Enable AD trusts with ipa-adtrust-install

3. Establish trust to an AD forest with at least root forest domain and a domain child:
   kinit admin
   ipa trust-add ...

4. Enable debugging in Samba: 
   smbcontrol smbd debug 10

5. Re-establish trust with 'ipa trust-add ...'

6. Disable debugging in Samba:
   smbcontrol smbd debug 1

7. Check that Samba logs do contain an error on attempting to delete non-leaf LDAP entry and then almost immediately successful deletes of first a child domain and then the forest trust root domain:
   egrep -B1 '(smbldap_delete:|Failed to delete)' /var/log/samba/log.*

[root@masteripa ~]# egrep -B1 '(smbldap_delete:|Failed to delete)' /var/log/samba/log.*
/var/log/samba/log.smbd.lsasd.1-[2014/01/21 21:16:39.533927,  5, pid=5644, effective(874400000, 874400000), real(874400000, 0)] ../source3/lib/smbldap.c:1535(smbldap_delete)
/var/log/samba/log.smbd.lsasd.1:  smbldap_delete: dn => [krbPrincipalName=krbtgt/AD12X.WEALD.VDA.LI.VDA.LI,cn=ad12x.weald.vda.li,cn=ad,cn=trusts,dc=ipa,dc=weald,dc=vda,dc=li]
--
/var/log/samba/log.smbd.lsasd.1-[2014/01/21 21:16:39.990100,  5, pid=5644, effective(874400000, 874400000), real(874400000, 0)] ../source3/lib/smbldap.c:1535(smbldap_delete)
/var/log/samba/log.smbd.lsasd.1:  smbldap_delete: dn => [krbPrincipalName=krbtgt/IPA.WEALD.VDA.LI.VDA.LI,cn=ad12x.weald.vda.li,cn=ad,cn=trusts,dc=ipa,dc=weald,dc=vda,dc=li]
--
/var/log/samba/log.smbd.lsasd.1-[2014/01/21 21:16:40.053891,  5, pid=5644, effective(874400000, 874400000), real(874400000, 0)] ../source3/lib/smbldap.c:1535(smbldap_delete)
/var/log/samba/log.smbd.lsasd.1:  smbldap_delete: dn => [cn=ad12x.weald.vda.li,cn=ad,cn=trusts,dc=ipa,dc=weald,dc=vda,dc=li]
--
/var/log/samba/log.smbd.lsasd.1-[2014/01/21 21:16:40.189246, 10, pid=5644, effective(874400000, 874400000), real(874400000, 0)] ../source3/lib/smbldap.c:1562(smbldap_delete)
/var/log/samba/log.smbd.lsasd.1:  Failed to delete dn: cn=ad12x.weald.vda.li,cn=ad,cn=trusts,dc=ipa,dc=weald,dc=vda,dc=li, error: 66 (Operation not allowed on non-leaf) (unknown)
--
/var/log/samba/log.smbd.lsasd.1-[2014/01/21 21:16:40.194136,  5, pid=5644, effective(874400000, 874400000), real(874400000, 0)] ../source3/lib/smbldap.c:1535(smbldap_delete)
/var/log/samba/log.smbd.lsasd.1:  smbldap_delete: dn => [cn=ad12y.ad12x.weald.vda.li,cn=ad12x.weald.vda.li,cn=ad,cn=trusts,dc=ipa,dc=weald,dc=vda,dc=li]
--
/var/log/samba/log.smbd.lsasd.1-[2014/01/21 21:16:40.354148,  5, pid=5644, effective(874400000, 874400000), real(874400000, 0)] ../source3/lib/smbldap.c:1535(smbldap_delete)
/var/log/samba/log.smbd.lsasd.1:  smbldap_delete: dn => [cn=ad12x.weald.vda.li,cn=ad,cn=trusts,dc=ipa,dc=weald,dc=vda,dc=li]
--

Comment 5 Steeve Goveas 2014-01-29 12:21:54 UTC
No '(smbldap_delete:|Failed to delete)' logs found. Is this the expected result?

[root@hp-bl280cg6-01 ~]# echo Secret123 | ipa trust-add adtest.qe --type ad --admin administrator --password
--------------------------------------------------
Added Active Directory trust for realm "adtest.qe"
--------------------------------------------------
  Realm name: adtest.qe
  Domain NetBIOS name: ADTEST
  Domain Security Identifier: S-1-5-21-1910160501-511572375-3625658879
  SID blacklist incoming: S-1-0, S-1-1, S-1-2, S-1-3, S-1-5-1, S-1-5-2, S-1-5-3, S-1-5-4, S-1-5-5, S-1-5-6, S-1-5-7, S-1-5-8, S-1-5-9, S-1-5-10, S-1-5-11, S-1-5-12, S-1-5-13, S-1-5-14, S-1-5-15, S-1-5-16,
                          S-1-5-17, S-1-5-18, S-1-5-19, S-1-5-20
  SID blacklist outgoing: S-1-0, S-1-1, S-1-2, S-1-3, S-1-5-1, S-1-5-2, S-1-5-3, S-1-5-4, S-1-5-5, S-1-5-6, S-1-5-7, S-1-5-8, S-1-5-9, S-1-5-10, S-1-5-11, S-1-5-12, S-1-5-13, S-1-5-14, S-1-5-15, S-1-5-16,
                          S-1-5-17, S-1-5-18, S-1-5-19, S-1-5-20
  Trust direction: Two-way trust
  Trust type: Active Directory domain
  Trust status: Established and verified

[root@hp-bl280cg6-01 ~]# ipa trustdomain-find adtest.qe
  Domain name: adtest.qe
  Domain NetBIOS name: ADTEST
  Domain Security Identifier: S-1-5-21-1910160501-511572375-3625658879
  Domain enabled: True

  Domain name: pune.adtest.qe
  Domain NetBIOS name: PUNE
  Domain Security Identifier: S-1-5-21-91314187-2404433721-1858927112
  Domain enabled: True
----------------------------
Number of entries returned 2
----------------------------

[root@hp-bl280cg6-01 ~]# smbcontrol smbd debug 10

[root@hp-bl280cg6-01 ~]# echo Secret123 | ipa trust-add adtest.qe --type ad --admin administrator --password
------------------------------------------
Re-established trust to domain "adtest.qe"
------------------------------------------
  Realm name: adtest.qe
  Domain NetBIOS name: ADTEST
  Domain Security Identifier: S-1-5-21-1910160501-511572375-3625658879
  SID blacklist incoming: S-1-0, S-1-1, S-1-2, S-1-3, S-1-5-1, S-1-5-2, S-1-5-3, S-1-5-4, S-1-5-5, S-1-5-6, S-1-5-7, S-1-5-8, S-1-5-9, S-1-5-10, S-1-5-11, S-1-5-12, S-1-5-13, S-1-5-14, S-1-5-15, S-1-5-16,
                          S-1-5-17, S-1-5-18, S-1-5-19, S-1-5-20
  SID blacklist outgoing: S-1-0, S-1-1, S-1-2, S-1-3, S-1-5-1, S-1-5-2, S-1-5-3, S-1-5-4, S-1-5-5, S-1-5-6, S-1-5-7, S-1-5-8, S-1-5-9, S-1-5-10, S-1-5-11, S-1-5-12, S-1-5-13, S-1-5-14, S-1-5-15, S-1-5-16,
                          S-1-5-17, S-1-5-18, S-1-5-19, S-1-5-20
  Trust direction: Two-way trust
  Trust type: Active Directory domain
  Trust status: Established and verified

[root@hp-bl280cg6-01 ~]# smbcontrol smbd debug 1

[root@hp-bl280cg6-01 ~]# ls /var/log/samba/
cores            log.smbd       log.smbd.lsasd    log.smbd.lsasd.10  log.smbd.lsasd.3  log.smbd.lsasd.5  log.smbd.lsasd.7  log.smbd.lsasd.9  log.wb-TESTRELM  log.winbindd-idmap
log.10.16.66.41  log.smbd.epmd  log.smbd.lsasd.1  log.smbd.lsasd.2   log.smbd.lsasd.4  log.smbd.lsasd.6  log.smbd.lsasd.8  log.wb-BUILTIN    log.winbindd     old

[root@hp-bl280cg6-01 ~]# egrep -B1 '(smbldap_delete:|Failed to delete)' /var/log/samba/log.*

[root@hp-bl280cg6-01 ~]# echo $?
1

[root@hp-bl280cg6-01 ~]# smbcontrol smbd debug 100

[root@hp-bl280cg6-01 ~]# echo Secret123 | ipa trust-add adtest.qe --type ad --admin administrator --password
------------------------------------------
Re-established trust to domain "adtest.qe"
------------------------------------------
  Realm name: adtest.qe
  Domain NetBIOS name: ADTEST
  Domain Security Identifier: S-1-5-21-1910160501-511572375-3625658879
  SID blacklist incoming: S-1-0, S-1-1, S-1-2, S-1-3, S-1-5-1, S-1-5-2, S-1-5-3, S-1-5-4, S-1-5-5, S-1-5-6, S-1-5-7, S-1-5-8, S-1-5-9, S-1-5-10, S-1-5-11, S-1-5-12, S-1-5-13, S-1-5-14, S-1-5-15, S-1-5-16,
                          S-1-5-17, S-1-5-18, S-1-5-19, S-1-5-20
  SID blacklist outgoing: S-1-0, S-1-1, S-1-2, S-1-3, S-1-5-1, S-1-5-2, S-1-5-3, S-1-5-4, S-1-5-5, S-1-5-6, S-1-5-7, S-1-5-8, S-1-5-9, S-1-5-10, S-1-5-11, S-1-5-12, S-1-5-13, S-1-5-14, S-1-5-15, S-1-5-16,
                          S-1-5-17, S-1-5-18, S-1-5-19, S-1-5-20
  Trust direction: Two-way trust
  Trust type: Active Directory domain
  Trust status: Established and verified

[root@hp-bl280cg6-01 ~]# smbcontrol smbd debug 1

[root@hp-bl280cg6-01 ~]# egrep -B1 '(smbldap_delete:|Failed to delete)' /var/log/samba/log.*

[root@hp-bl280cg6-01 ~]# echo $?
1

[root@hp-bl280cg6-01 ~]# rpm -q ipa-server
ipa-server-3.3.3-15.el7.x86_64

Comment 6 Alexander Bokovoy 2014-02-11 08:47:56 UTC
I've looked into two different test machines Steve prepared for verifying this bug and found out that the code works correctly. However, communication with AD DC is broken due to incorrectly configured firewalld.

As soon as firewalld was stopped (and iptables configuration was cleared), everything started working properly.

While we need to improve firewalld configuration for IPA cases, I think with clean firewall we can verify this bug.

Comment 7 Steeve Goveas 2014-02-11 12:18:49 UTC
[root@dhcp207-151 ~]# echo Secret123 | ipa trust-add adtest.qe --type ad --admin administrator --password
--------------------------------------------------
Added Active Directory trust for realm "adtest.qe"
--------------------------------------------------
  Realm name: adtest.qe
  Domain NetBIOS name: ADTEST
  Domain Security Identifier: S-1-5-21-1910160501-511572375-3625658879
  SID blacklist incoming: S-1-0, S-1-1, S-1-2, S-1-3, S-1-5-1, S-1-5-2, S-1-5-3, S-1-5-4, S-1-5-5, S-1-5-6, S-1-5-7, S-1-5-8, S-1-5-9, S-1-5-10,
                          S-1-5-11, S-1-5-12, S-1-5-13, S-1-5-14, S-1-5-15, S-1-5-16, S-1-5-17, S-1-5-18, S-1-5-19, S-1-5-20
  SID blacklist outgoing: S-1-0, S-1-1, S-1-2, S-1-3, S-1-5-1, S-1-5-2, S-1-5-3, S-1-5-4, S-1-5-5, S-1-5-6, S-1-5-7, S-1-5-8, S-1-5-9, S-1-5-10,
                          S-1-5-11, S-1-5-12, S-1-5-13, S-1-5-14, S-1-5-15, S-1-5-16, S-1-5-17, S-1-5-18, S-1-5-19, S-1-5-20
  Trust direction: Two-way trust
  Trust type: Active Directory domain
  Trust status: Established and verified

[root@dhcp207-151 ~]# getent passwd aduser2 
aduser2:*:1148401314:1148401314:ads2 user:/home/adtest.qe/aduser2:

[root@dhcp207-151 ~]# ipa trustdomain-find
Realm name: adtest.qe
  Domain name: adtest.qe
  Domain NetBIOS name: ADTEST
  Domain Security Identifier: S-1-5-21-1910160501-511572375-3625658879
  Domain enabled: True

  Domain name: pune.adtest.qe
  Domain NetBIOS name: PUNE
  Domain Security Identifier: S-1-5-21-91314187-2404433721-1858927112
  Domain enabled: True
----------------------------
Number of entries returned 2
----------------------------

[root@dhcp207-151 ~]# smbcontrol all debug 100

[root@dhcp207-151 ~]# echo Secret123 | ipa trust-add adtest.qe --type ad --admin administrator --password
------------------------------------------
Re-established trust to domain "adtest.qe"
------------------------------------------
  Realm name: adtest.qe
  Domain NetBIOS name: ADTEST
  Domain Security Identifier: S-1-5-21-1910160501-511572375-3625658879
  SID blacklist incoming: S-1-0, S-1-1, S-1-2, S-1-3, S-1-5-1, S-1-5-2, S-1-5-3, S-1-5-4, S-1-5-5, S-1-5-6, S-1-5-7, S-1-5-8, S-1-5-9, S-1-5-10,
                          S-1-5-11, S-1-5-12, S-1-5-13, S-1-5-14, S-1-5-15, S-1-5-16, S-1-5-17, S-1-5-18, S-1-5-19, S-1-5-20
  SID blacklist outgoing: S-1-0, S-1-1, S-1-2, S-1-3, S-1-5-1, S-1-5-2, S-1-5-3, S-1-5-4, S-1-5-5, S-1-5-6, S-1-5-7, S-1-5-8, S-1-5-9, S-1-5-10,
                          S-1-5-11, S-1-5-12, S-1-5-13, S-1-5-14, S-1-5-15, S-1-5-16, S-1-5-17, S-1-5-18, S-1-5-19, S-1-5-20
  Trust direction: Two-way trust
  Trust type: Active Directory domain
  Trust status: Established and verified

[root@dhcp207-151 ~]# getent passwd aduser2 
aduser2:*:1148401314:1148401314:ads2 user:/home/adtest.qe/aduser2:

[root@dhcp207-151 ~]# ipa trustdomain-find
Realm name: adtest.qe
  Domain name: adtest.qe
  Domain NetBIOS name: ADTEST
  Domain Security Identifier: S-1-5-21-1910160501-511572375-3625658879
  Domain enabled: True

  Domain name: pune.adtest.qe
  Domain NetBIOS name: PUNE
  Domain Security Identifier: S-1-5-21-91314187-2404433721-1858927112
  Domain enabled: True
----------------------------
Number of entries returned 2
----------------------------

[root@dhcp207-151 ~]# egrep -B1 '(smbldap_delete:|Failed to delete)' /var/log/samba/log.*
/var/log/samba/log.smbd.lsasd.15-[2014/02/11 17:46:41.656231,  5, pid=32505, effective(1297000000, 1297000000), real(1297000000, 0)] ../source3/lib/smbldap.c:1535(smbldap_delete)
/var/log/samba/log.smbd.lsasd.15:  smbldap_delete: dn => [krbPrincipalName=krbtgt/ADTEST.QE,cn=adtest.qe,cn=ad,cn=trusts,dc=newdom,dc=qe]
--
/var/log/samba/log.smbd.lsasd.15-[2014/02/11 17:46:41.833868,  5, pid=32505, effective(1297000000, 1297000000), real(1297000000, 0)] ../source3/lib/smbldap.c:1535(smbldap_delete)
/var/log/samba/log.smbd.lsasd.15:  smbldap_delete: dn => [krbPrincipalName=krbtgt/NEWDOM.QE,cn=adtest.qe,cn=ad,cn=trusts,dc=newdom,dc=qe]
--
/var/log/samba/log.smbd.lsasd.15-[2014/02/11 17:46:41.857713,  5, pid=32505, effective(1297000000, 1297000000), real(1297000000, 0)] ../source3/lib/smbldap.c:1535(smbldap_delete)
/var/log/samba/log.smbd.lsasd.15:  smbldap_delete: dn => [cn=adtest.qe,cn=ad,cn=trusts,dc=newdom,dc=qe]
--
/var/log/samba/log.smbd.lsasd.15-[2014/02/11 17:46:41.865933, 10, pid=32505, effective(1297000000, 1297000000), real(1297000000, 0)] ../source3/lib/smbldap.c:1562(smbldap_delete)
/var/log/samba/log.smbd.lsasd.15:  Failed to delete dn: cn=adtest.qe,cn=ad,cn=trusts,dc=newdom,dc=qe, error: 66 (Operation not allowed on non-leaf) (unknown)
--
/var/log/samba/log.smbd.lsasd.15-[2014/02/11 17:46:41.867786,  5, pid=32505, effective(1297000000, 1297000000), real(1297000000, 0)] ../source3/lib/smbldap.c:1535(smbldap_delete)
/var/log/samba/log.smbd.lsasd.15:  smbldap_delete: dn => [cn=pune.adtest.qe,cn=adtest.qe,cn=ad,cn=trusts,dc=newdom,dc=qe]
--
/var/log/samba/log.smbd.lsasd.15-[2014/02/11 17:46:41.891181,  5, pid=32505, effective(1297000000, 1297000000), real(1297000000, 0)] ../source3/lib/smbldap.c:1535(smbldap_delete)
/var/log/samba/log.smbd.lsasd.15:  smbldap_delete: dn => [cn=adtest.qe,cn=ad,cn=trusts,dc=newdom,dc=qe]

Comment 8 Ludek Smid 2014-06-13 11:19:01 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


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