Red Hat Bugzilla – Bug 1382053
Need to have validation for idrange names
Last modified: 2017-08-01 05:42:02 EDT
Description of problem: Need to have validation for idrange name Version-Release number of selected component (if applicable): ipa-server-4.4.0-12.el7.x86_64 How reproducible: Always 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 error_log [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:
Upstream ticket: https://fedorahosted.org/freeipa/ticket/6404
Fixed upstream master: https://pagure.io/freeipa/c/70743c8c48db54309a09d510b3a5d8ae86c29e58 ipa-4-5: https://pagure.io/freeipa/c/077a61524d79ac5ab6f0eb46450c82ad5594bd2b
Upstream regression test added: master: https://pagure.io/freeipa/c/342dccea47f6cb14cda63f75789eab51070fb3f6 ipa-4-5: https://pagure.io/freeipa/c/ab2706721db217d55ae549d50a95ace571e65aa6
Internal error is no more displayed. Tested on RHEL7.4 using ipa-server-4.5.0-11.el7.x86_64 389-ds-base-1.3.6.1-13.el7.x86_64 pki-ca-10.4.1-4.el7.noarch krb5-server-1.15.1-8.el7.x86_64 sssd-1.15.2-29.el7.x86_64 [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
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://access.redhat.com/errata/RHBA-2017:2304