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 797565 - escaping commas is not working
Summary: escaping commas is not working
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: ipa
Version: 6.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Rob Crittenden
QA Contact: IDM QE LIST
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-02-26 18:08 UTC by Dmitri Pal
Modified: 2013-08-19 15:44 UTC (History)
4 users (show)

Fixed In Version: ipa-2.2.0-6.el6
Doc Type: Bug Fix
Doc Text:
Cause: Comma separated values (CSV) were splitted both in CLI part of IPA processing and the server part too. Consequence: Potential comma escaping was not recognized on the server because the escaping already got lost in client CSV processing. This lead to issues with values with comma included. Fix: CSV processing is done only in client interface. IPA server RPC interfaces (both XML-RPC and JSON-RPC) no longer process CSV values, it now expects either a scalar value or a list of scalar values. Comma escaping is replaced with quoting. Result: User can now pass quoted values with embedded commas to IPA CLI interface to avoid CSV split and thus properly pass the value with a comma to IPA server processing.
Clone Of:
Environment:
Last Closed: 2012-06-20 13:19:39 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0819 0 normal SHIPPED_LIVE ipa bug fix and enhancement update 2012-06-19 20:34:17 UTC

Description Dmitri Pal 2012-02-26 18:08:06 UTC
This bug is created as a clone of upstream ticket:
https://fedorahosted.org/freeipa/ticket/2417

There is a test in roles to verify that escaping commas works as expected. It is failing, as demonstrated by:

{{{
$ ipa role-add-privilege --privileges="u,r stuff" test
  Role name: test
  Description: test
  Failed members: 
    privilege: u: privilege not found
    privilege: r stuff: privilege not found
----------------------------
Number of privileges added 0
----------------------------
}}}

Comment 1 Martin Kosek 2012-03-22 16:50:16 UTC
Fixed upstream:

master: dddebe23507749486fb09d219f0da4f483ba4e79
ipa-2-2: 3738a611a678e6c23be38dacbad8955299cbe5bb

Note for testing:
The correct command is:

ipa role-add-privilege --privileges='"u,r stuff"' test

The double quotes are for the CSV parser. Single quotes are needed so the shell doesn't interpret the double ones.

Comment 4 Namita Soman 2012-04-12 13:02:06 UTC
Verified using ipa-server-2.2.0-8.el6.x86_64

# ipa role-add-privilege --privileges='"u, r stuff"' test
  Role name: test
  Description: test
  Privileges: u, r stuff
----------------------------
Number of privileges added 1
----------------------------

Also verified in UI.

Comment 5 Steeve Goveas 2012-04-13 09:06:50 UTC
1. Adding 2 comma separated privileges

[root@wheeljack ~]# ipa role-add-privilege --privileges="u,r stuff" test
  Role name: test
  Description: Test Role
  Privileges: u, r stuff
----------------------------
Number of privileges added 2
----------------------------

[root@wheeljack ~]# ipa role-remove-privilege --privileges="u,r stuff" test
  Role name: test
  Description: Test Role
------------------------------
Number of privileges removed 2
------------------------------


2. Adding a privilege having comma as part of the privilege name

[root@wheeljack ~]# ipa privilege-add 'u,r stuff'
Description: privilege with comma
---------------------------
Added privilege "u,r stuff"
---------------------------
  Privilege name: u,r stuff
  Description: privilege with comma

[root@wheeljack ~]# ipa role-add-privilege --privileges='"u,r stuff"' test
  Role name: test
  Description: Test Role
  Privileges: u,r stuff
----------------------------
Number of privileges added 1
----------------------------

Both above cases work as expected. Verified in version ipa-server-2.2.0-8.el6.x86_64

Comment 6 Martin Kosek 2012-04-24 12:55:02 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause: Comma separated values (CSV) were splitted both in CLI part of IPA processing and the server part too.
Consequence: Potential comma escaping was not recognized on the server because the escaping already got lost in client CSV processing. This lead to issues with values with comma included.
Fix: CSV processing is done only in client interface. IPA server RPC interfaces (both XML-RPC and JSON-RPC) no longer process CSV values, it now expects either a scalar value or a list of scalar values. Comma escaping is replaced with quoting.
Result: User can now pass quoted values with embedded commas to IPA CLI interface to avoid CSV split and thus properly pass the value with a comma to IPA server processing.

Comment 8 errata-xmlrpc 2012-06-20 13:19:39 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/RHBA-2012-0819.html


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