Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1356524

Summary: Add check and avoid error message when external trust is added with option --range-type having values ipa-ad-trust-posix/ipa-ad-trust
Product: Red Hat Enterprise Linux 7 Reporter: Sudhir Menon <sumenon>
Component: ipaAssignee: IPA Maintainers <ipa-maint>
Status: CLOSED WORKSFORME QA Contact: Kaleem <ksiddiqu>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.3CC: abokovoy, pvoborni, rcritten
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-19 09:44:25 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 2016-07-14 10:10:51 UTC
Description of problem: Add check and avoid error message displayed while adding external trust with option --range-type having values ipa-ad-trust-posix/ipa-ad-trust


Version-Release number of selected component (if applicable):
ipa-server-trust-ad-4.4.0-1.el7.x86_64
ipa-server-4.4.0-1.el7.x86_64

How reproducible:Always


Steps to Reproduce:

1. Add external trust with range-type as ipa-ad-trust-posix

[root@server sssd]# ipa trust-add --type='ad' --base-id=150000 --range-size=10000 --range-type='ipa-ad-trust-posix' 
Realm name: test.qa
Active Directory domain administrator: administrator
Active Directory domain administrator's password: 

2. Add external trust with range-type as ipa-ad-trust

[root@server sssd]# ipa trust-add --type='ad' --base-id=150000 --range-size=10000 --range-type='ipa-ad-trust' 
Realm name: test.qa
Active Directory domain administrator: administrator
Active Directory domain administrator's password: 

Actual results:
1. ipa: ERROR: Domain 'test.qa' is not a root domain for forest 'pne.qe'
2. ipa: ERROR: Domain 'test.qa' is not a root domain for forest 'pne.qe'


Expected results:
Add checks and avoid the error.

Additional info: Test enviornment.

pne.qe is forest root domain
test.qa is the tree root domain.

Comment 2 Petr Vobornik 2016-07-21 16:18:37 UTC
Upstream ticket:
https://fedorahosted.org/freeipa/ticket/6107

Comment 3 Sudhir Menon 2016-08-19 09:40:50 UTC
I am now able to run the below commands without any error.

Verified using RHEL7.3
ipa-server-4.4.0-8.el7.x86_64
ipa-server-trust-ad-4.4.0-8.el7.x86_64

[root@ipaserver ~]# ipa trust-add test.qa --type='ad' --base-id=150000 --range-size=100000 --range-type='ipa-ad-trust' --external=true
Active Directory domain administrator: Administrator
Active Directory domain administrator's password:
------------------------------------------------
Added Active Directory trust for realm "test.qa"
------------------------------------------------
Realm name: test.qa
Domain NetBIOS name: TEST
Domain Security Identifier: S-1-5-21-4204873575-1158510886-1449965812
Trust direction: Trusting forest
Trust type: Non-transitive external trust to a domain in another Active Directory forest
Trust status: Established and verified
     
   
[root@ipaserver ~]# ipa idrange-find
----------------
2 ranges matched
----------------
Range name: REDLABS.QE_id_range
First Posix ID of the range: 1748200000
Number of IDs in the range: 200000
First RID of the corresponding RID range: 1000
First RID of the secondary RID range: 100000000
Range type: local domain range
     
Range name: TEST.QA_id_range
First Posix ID of the range: 150000
Number of IDs in the range: 100000
First RID of the corresponding RID range: 0
Domain SID of the trusted domain: S-1-5-21-4204873575-1158510886-1449965812
Range type: Active Directory domain range
----------------------------
Number of entries returned 2
----------------------------
     
[root@ipaserver ~]# ipa trust-add test.qa --type='ad' --base-id=150000 --range-size=100000 --range-type='ipa-ad-trust-posix' --external=true
Active Directory domain administrator: Administrator
Active Directory domain administrator's password:
ipa: ERROR: invalid 'id range': An id range already exists for this trust. You should either delete the old range, or exclude --base-id/--range-size options from the command.
     
[root@ipaserver ~]# ipa trust-add test.qa --type='ad'  --range-type='ipa-ad-trust-posix' --external=true
Active Directory domain administrator: Administrator
Active Directory domain administrator's password:
ipa: ERROR: invalid 'range type change': ID range for the trusted domain already exists, but it has a different type. Please remove the old range manually, or do not enforce type via --range-type option
     
[root@ipaserver ~]# ipa trust-del test.qa
-----------------------
Deleted trust "test.qa"
-----------------------

[root@ipaserver ~]# ipa idrange-del TEST.QA_id_range
-----------------------------------
Deleted ID range "TEST.QA_id_range"
-----------------------------------

[root@ipaserver ~]# ipa trust-add test.qa --type='ad'  --range-type='ipa-ad-trust-posix' --external=true
Active Directory domain administrator: Administrator
Active Directory domain administrator's password:
------------------------------------------------
Added Active Directory trust for realm "test.qa"
------------------------------------------------
Realm name: test.qa
Domain NetBIOS name: TEST
Domain Security Identifier: S-1-5-21-4204873575-1158510886-1449965812
Trust direction: Trusting forest
Trust type: Non-transitive external trust to a domain in another Active Directory forest
Trust status: Established and verified

Comment 4 Alexander Bokovoy 2016-08-19 09:44:25 UTC
Closing WORKSFORME as no changes were done.