Bug 1382053 - Need to have validation for idrange names
Summary: Need to have validation for idrange names
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: ipa
Version: 7.3
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: IPA Maintainers
QA Contact: Kaleem
Depends On:
TreeView+ depends on / blocked
Reported: 2016-10-05 15:32 UTC by Sudhir Menon
Modified: 2017-08-01 09:42 UTC (History)
4 users (show)

Fixed In Version: ipa-4.5.0-6.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2017-08-01 09:42:02 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:2304 normal SHIPPED_LIVE ipa bug fix and enhancement update 2017-08-01 12:41:35 UTC

Description Sudhir Menon 2016-10-05 15:32:19 UTC
Description of problem: Need to have validation for idrange name

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

How reproducible:

Steps to Reproduce:
1. Ensure two-way trust is added with IPA server
2. Now run the below command with empty domain name.

#ipa idrange-add _id_range2 --dom-name= --rid-base=200000 --base-id=55 --range-size=5

3. Check the message on the console

Actual results:
[root@master]# ipa idrange-add _id_range2 --dom-name= --rid-base=200000 --base-id=55 --range-size=5
ipa: ERROR: an internal error has occurred


[Wed Oct 05 20:44:44.789504 2016] [:error] [pid 30073]   File "/usr/lib/python2.7/site-packages/ipaserver/plugins/idrange.py", line 421, in pre_callback
[Wed Oct 05 20:44:44.789506 2016] [:error] [pid 30073]     options['ipanttrusteddomainname'])
[Wed Oct 05 20:44:44.789509 2016] [:error] [pid 30073]   File "/usr/lib/python2.7/site-packages/ipaserver/plugins/idrange.py", line 354, in get_trusted_domain_sid_from_name
[Wed Oct 05 20:44:44.789519 2016] [:error] [pid 30073]     sid = domain_validator.get_sid_from_domain_name(name)
[Wed Oct 05 20:44:44.789522 2016] [:error] [pid 30073]   File "/usr/lib/python2.7/site-packages/ipaserver/dcerpc.py", line 342, in get_sid_from_domain_name
[Wed Oct 05 20:44:44.789525 2016] [:error] [pid 30073]     if name in domains:
[Wed Oct 05 20:44:44.789527 2016] [:error] [pid 30073]   File "/usr/lib/python2.7/site-packages/ipapython/ipautil.py", line 671, in __contains__
[Wed Oct 05 20:44:44.789530 2016] [:error] [pid 30073]     return super(CIDict, self).__contains__(key.lower())
[Wed Oct 05 20:44:44.789532 2016] [:error] [pid 30073] AttributeError: 'NoneType' object has no attribute 'lower'
[Wed Oct 05 20:44:44.789938 2016] [:error] [pid 30073] ipa: INFO: [jsonserver_session] admin@TESTRELM.TEST: idrange_add/1(u'_id_range2', ipabaseid=55, ipaidrangesize=5, ipabaserid=200000, ipanttrusteddomainname=None, version=u'2.213'): AttributeError
Expected results:
Internal error should be fixed.

Additional info:

Comment 3 Petr Vobornik 2016-10-14 12:19:39 UTC
Upstream ticket:

Comment 8 Sudhir Menon 2017-05-15 13:05:57 UTC
Internal error is no more displayed.
Tested on RHEL7.4 using 


[root@master yum.repos.d]# ipa idrange-add _id_range2 --dom-name= --rid-base=200000 --base-id=55 --range-size=5
ipa: ERROR: invalid 'ID Range setup': Options secondary-rid-base and rid-base must be used together

[Mon May 15 09:04:04.426808 2017] [:error] [pid 27778] ipa: INFO: [jsonserver_session] admin@TESTRELM.TEST: idrange_add/1(u'_id_range2', ipabaseid=55, ipaidrangesize=5, ipabaserid=200000, ipanttrusteddomainname=None, version=u'2.224'): ValidationError

Comment 9 errata-xmlrpc 2017-08-01 09:42:02 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.


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