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 816574 - ipa permission-add throws internal server error when --addattr or --setattr is blank
Summary: ipa permission-add throws internal server error when --addattr or --setattr i...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: ipa
Version: 6.2
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: rc
: ---
Assignee: Rob Crittenden
QA Contact: Namita Soman
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-04-26 12:40 UTC by Namita Soman
Modified: 2013-08-19 14:12 UTC (History)
2 users (show)

Fixed In Version: ipa-3.0.0-1.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-02-21 09:11:53 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2013:0528 0 normal SHIPPED_LIVE Low: ipa security, bug fix and enhancement update 2013-02-21 08:22:21 UTC

Description Namita Soman 2012-04-26 12:40:02 UTC
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: 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: permission_add(u'TestPermission', permissions=(u'write',), attrs=(u'carlicense',), type=u'hostgroup', addattr=None, all=False, raw=False, version=u'2.34'): TypeError

Comment 2 Martin Kosek 2012-04-26 13:06:26 UTC
Upstream ticket:
https://fedorahosted.org/freeipa/ticket/2680

Comment 3 Martin Kosek 2012-05-07 15:24:22 UTC
Fixed upstream:
master: https://fedorahosted.org/freeipa/changeset/abef5e8c027bf37d9522f4d30e8e43c408251893

Comment 6 Namita Soman 2013-01-14 14:25:14 UTC
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"'

Comment 8 errata-xmlrpc 2013-02-21 09:11:53 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.

http://rhn.redhat.com/errata/RHSA-2013-0528.html


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