Red Hat Bugzilla – Bug 816574
ipa permission-add throws internal server error when --addattr or --setattr is blank
Last modified: 2013-08-19 10:12:04 EDT
Description of problem: ipa permission-add throws internal server error when --addattr or --setattr is blank # ipa permission-add TestPermission --permissions="write" --type=hostgroup --attr=carlicense --addattr= And # ipa permission-add TestPermission --permissions="write" --type=hostgroup --attr=carlicense --setattr="" throw ipa: ERROR: an internal error has occurred Version-Release number of selected component (if applicable): ipa-server-2.2.0-11.el6.x86_64 How reproducible: always Steps to Reproduce: 1.# ipa permission-add TestPermission --permissions="write" --type=hostgroup --attr=carlicense --addattr= Actual results: ipa: ERROR: an internal error has occurred Expected results: Better error Additional info: [Thu Apr 26 08:27:15 2012] [error] ipa: INFO: admin@TESTRELM.COM: privilege_add(u'Add User with blank attr', description=u'Add User with blank attr', setattr=None, all=False, raw=False, version=u'2.34'): TypeError [Thu Apr 26 08:32:08 2012] [error] ipa: ERROR: non-public: TypeError: expected string or buffer [Thu Apr 26 08:32:08 2012] [error] Traceback (most recent call last): [Thu Apr 26 08:32:08 2012] [error] File "/usr/lib/python2.6/site-packages/ipaserver/rpcserver.py", line 320, in wsgi_execute [Thu Apr 26 08:32:08 2012] [error] result = self.Command[name](*args, **options) [Thu Apr 26 08:32:08 2012] [error] File "/usr/lib/python2.6/site-packages/ipalib/frontend.py", line 438, in __call__ [Thu Apr 26 08:32:08 2012] [error] ret = self.run(*args, **options) [Thu Apr 26 08:32:08 2012] [error] File "/usr/lib/python2.6/site-packages/ipalib/frontend.py", line 716, in run [Thu Apr 26 08:32:08 2012] [error] return self.execute(*args, **options) [Thu Apr 26 08:32:08 2012] [error] File "/usr/lib/python2.6/site-packages/ipalib/plugins/baseldap.py", line 978, in execute [Thu Apr 26 08:32:08 2012] [error] self.process_attr_options(entry_attrs, None, keys, options) [Thu Apr 26 08:32:08 2012] [error] File "/usr/lib/python2.6/site-packages/ipalib/plugins/baseldap.py", line 853, in process_attr_options [Thu Apr 26 08:32:08 2012] [error] adddict = self._convert_2_dict(options.get('addattr', [])) [Thu Apr 26 08:32:08 2012] [error] File "/usr/lib/python2.6/site-packages/ipalib/plugins/baseldap.py", line 806, in _convert_2_dict [Thu Apr 26 08:32:08 2012] [error] m = re.match("\\s*(.*?)\\s*=\\s*(.*?)\\s*$", a) [Thu Apr 26 08:32:08 2012] [error] File "/usr/lib64/python2.6/re.py", line 137, in match [Thu Apr 26 08:32:08 2012] [error] return _compile(pattern, flags).match(string) [Thu Apr 26 08:32:08 2012] [error] TypeError: expected string or buffer [Thu Apr 26 08:32:08 2012] [error] ipa: INFO: admin@TESTRELM.COM: permission_add(u'TestPermission', permissions=(u'write',), attrs=(u'carlicense',), type=u'hostgroup', addattr=None, all=False, raw=False, version=u'2.34'): TypeError
Upstream ticket: https://fedorahosted.org/freeipa/ticket/2680
Fixed upstream: master: https://fedorahosted.org/freeipa/changeset/abef5e8c027bf37d9522f4d30e8e43c408251893
Verified using: ipa-server-3.0.0-20.el6.x86_64 :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: [ LOG ] :: ipa-permission-cli-1032 - add permission with missing addattr value (bug 816574) :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: [ PASS ] :: Verify error message for missing addattr :: [ PASS ] :: File '/tmp/tmp.FGH5wfGkhd/ipapermission_missingaddattr1.log' should contain 'ipa: error: --addattr option requires an argument' :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: [ LOG ] :: ipa-permission-cli-1034 - add permission with missing setattr value (bug 816574) :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: [ PASS ] :: Verify error message for missing setattr :: [ PASS ] :: File '/tmp/tmp.nqBo9qpHMv/ipapermission_missingsetattr1.log' should contain 'ipa: error: --setattr option requires an argument' :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: [ LOG ] :: ipa-privilege-cli-1010 - add privilege with blank setattr (bug 816574) :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: [ PASS ] :: Verify Add User with blank attr privilege is added successfully :: [ PASS ] :: File '/tmp/tmp.nqBo9qpHMv/ipaprivilege_blankattr.log' should contain 'Added privilege "Add User with blank attr"' :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: [ LOG ] :: ipa-role-cli-1009 - add role with blank setattr (bug 816574) :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: [ PASS ] :: Running 'addRole "Hostgroup Admin with blank seeAlso" "Hostgroup Admin with blank seeAlso" --setattr="" > /tmp/tmp.nqBo9qpHMv/iparole_blankattr.log 2>&1' :: [ PASS ] :: File '/tmp/tmp.nqBo9qpHMv/iparole_blankattr.log' should contain 'Added role "Hostgroup Admin with blank seeAlso"'
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. http://rhn.redhat.com/errata/RHSA-2013-0528.html