Bug 797569 - embedded carriage returns in a CSV not handled
Summary: embedded carriage returns in a CSV not handled
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:13 UTC by Dmitri Pal
Modified: 2013-05-22 18:50 UTC (History)
3 users (show)

Fixed In Version: ipa-2.2.0-8.el6
Doc Type: Bug Fix
Doc Text:
No documentation needed.
Clone Of:
Environment:
Last Closed: 2012-06-20 13:19:50 UTC
Target Upstream Version:


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:13:38 UTC
This bug is created as a clone of upstream ticket:
https://fedorahosted.org/freeipa/ticket/2402

I was going to test the problem in BZ https://bugzilla.redhat.com/show_bug.cgi?id=794474 and just cut and pasted the command-line. It ended up pasting as several lines but the double-quotes kept it all together. This was not liked by the CSV parser:

{{{
$ ipa config-mod --userobjectclasses="top, person, organizationalperson,
> inetorgperson, inetuser, posixaccount, krbprincipalaux, krbticketpolicyaux,
> ipaobject, ipasshuser, sambasamaccount"
ipa: ERROR: unhandled exception: Error: new-line character seen in unquoted field - do you need to open the file in universal-newline mode?
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/ipalib/backend.py", line 125, in execute
    result = self.Command[_name](*args, **options)
  File "/usr/lib/python2.7/site-packages/ipalib/frontend.py", line 427, in __call__
    params = self.normalize(**params)
  File "/usr/lib/python2.7/site-packages/ipalib/frontend.py", line 578, in normalize
    (k, self.params[k].normalize(v)) for (k, v) in kw.iteritems()
  File "/usr/lib/python2.7/site-packages/ipalib/frontend.py", line 578, in <genexpr>
    (k, self.params[k].normalize(v)) for (k, v) in kw.iteritems()
  File "/usr/lib/python2.7/site-packages/ipalib/parameters.py", line 725, in normalize
    newval += tuple(csvreader.next()) #pylint: disable=E1101
  File "/usr/lib/python2.7/site-packages/ipalib/parameters.py", line 690, in __unicode_csv_reader
    for row in csv_reader:
Error: new-line character seen in unquoted field - do you need to open the file in universal-newline mode?
ipa: ERROR: an internal error has occurred
}}}

Comment 1 Rob Crittenden 2012-03-29 19:10:32 UTC
Fixed upstream.

master: 0b62700c8ca46cf41e2cd53ea9154ae558019a05

ipa-2-2: bc7111a3ea15a9370fb860c6aefe652afac508a8

Comment 5 Martin Kosek 2012-04-24 13:29:32 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:
No documentation needed.

Comment 6 Scott Poore 2012-05-07 20:15:28 UTC
Verified.

Version :: ipa-server-2.2.0-12.el6.x86_64

Automated Test Results ::

[root@spoore-dvm1 ipa-config]# ipaconfig_bugzillas

...

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: bz797569 embedded carriage returns in a CSV not handled
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [15:14:10] ::  Running ipa config-mod with quoted multiline entry
:: [15:14:10] ::  ipa config-mod --userobjectclasses="top, person, organizationalperson,
:: [15:14:10] ::  inetorgperson, inetuser, posixaccount, krbprincipalaux, krbticketpolicyaux,
:: [15:14:10] ::  ipaobject, ipasshuser, sambasamaccount"
:: [   PASS   ] :: Running script with multiline command
  Default user objectclasses: top, person, organizationalperson, inetorgperson, inetuser, posixaccount, krbprincipalaux, krbticketpolicyaux, ipaobject, ipasshuser, sambasamaccount
:: [   PASS   ] :: Running 'ipa config-show --all|grep "top, person, organizationalperson, inetorgperson, inetuser, posixaccount, krbprincipalaux, krbticketpolicyaux, ipaobject, ipasshuser, sambasamaccount"'
:: [   PASS   ] :: BZ 797569 not found
:: [   PASS   ] :: ipa config-mod with multiple lines quoted and separated by newline passed


Manual Test Results ::

# ipa config-mod --userobjectclasses="top, person, organizationalperson,
> inetorgperson, inetuser, posixaccount, krbprincipalaux, krbticketpolicyaux,
> ipaobject, ipasshuser"
  Maximum username length: 32
  Home directory base: /home
  Default shell: /bin/sh
  Default users group: ipausers
  Default e-mail domain: testrelm.com
  Search time limit: 2
  Search size limit: 100
  User search fields: uid,givenname,sn,telephonenumber,ou,title
  Group search fields: cn,description
  Enable migration mode: FALSE
  Certificate Subject base: O=TESTRELM.COM
  Default user objectclasses: top, person, organizationalperson, inetorgperson, inetuser, posixaccount,
                              krbprincipalaux, krbticketpolicyaux, ipaobject, ipasshuser
  Password Expiration Notification (days): 4
  Password plugin features: AllowNThash
  SELinux user map order: guest_u:s0$xguest_u:s0$user_u:s0-s0:c0.c1023$staff_u:s0-s0:c0.c1023$unconfined_u:s0-s0:c0.c1023
  Default SELinux user: guest_u:s0

# ipa config-mod --userobjectclasses="top, person, organizationalperson,
inetorgperson, inetuser, posixaccount, krbprincipalaux, krbticketpolicyaux,
ipaobject, ipasshuser, sambasamaccount"
  Maximum username length: 32
  Home directory base: /home
  Default shell: /bin/sh
  Default users group: ipausers
  Default e-mail domain: testrelm.com
  Search time limit: 2
  Search size limit: 100
  User search fields: uid,givenname,sn,telephonenumber,ou,title
  Group search fields: cn,description
  Enable migration mode: FALSE
  Certificate Subject base: O=TESTRELM.COM
  Default user objectclasses: top, person, organizationalperson, inetorgperson, inetuser, posixaccount,
                              krbprincipalaux, krbticketpolicyaux, ipaobject, ipasshuser, sambasamaccount
  Password Expiration Notification (days): 4
  Password plugin features: AllowNThash
  SELinux user map order: guest_u:s0$xguest_u:s0$user_u:s0-s0:c0.c1023$staff_u:s0-s0:c0.c1023$unconfined_u:s0-s0:c0.c1023
  Default SELinux user: guest_u:s0

Comment 8 errata-xmlrpc 2012-06-20 13:19:50 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.