This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 853203 - Sudo -i isn't passing command arguments containing spaces properly as of sudo-1.7.2p1-14.el5_8.3
Sudo -i isn't passing command arguments containing spaces properly as of sudo...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: sudo (Show other bugs)
5.8
x86_64 Unspecified
medium Severity medium
: beta
: ---
Assigned To: Daniel Kopeček
Dalibor Pospíšil
: Regression
Depends On:
Blocks: 883145
  Show dependency treegraph
 
Reported: 2012-08-30 13:45 EDT by Mike Hanby
Modified: 2013-09-30 20:28 EDT (History)
14 users (show)

See Also:
Fixed In Version: sudo-1.7.2p1-25.el5
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-09-30 20:28:30 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 357173 None None None Never

  None (edit)
Description Mike Hanby 2012-08-30 13:45:21 EDT
Description of problem:
I have a ruby script that I run via "sudo -i". The script expects some of its arguments to have spaces (ex: --fullname 'My Name').

Prior to updating sudo to sudo-1.7.2p1-14.el5_8.3, this worked. Now, the script variable associated with --fullname will only contain the portion up to the space, ex: My

Version-Release number of selected component (if applicable):
sudo-1.7.2p1-14.el5_8.3

How reproducible:
I'm able to reproduce this on EL5 and EL6, however Fedora 17 the code still works properly:

Works on EL5: sudo-1.7.2p1-14.el5_8
Fail on EL5: sudo-1.7.2p1-14.el5_8.2 and sudo-1.7.2p1-14.el5_8.3
Fail on EL6: sudo-1.7.4p5-13.el6_3.x86_64
Works on Fedora 17: sudo-1.8.3p1-7.fc17.x86_64

Steps to Reproduce:
1. Create the following test script:

#!/usr/bin/ruby -w
puts "Arg 0: #{ARGV[0]}" if ARGV[0]
puts "Arg 1: #{ARGV[1]}" if ARGV[1]
puts "Arg 2: #{ARGV[2]}" if ARGV[2]
puts "Arg 3: #{ARGV[3]}" if ARGV[3]

2. Execute the script using sudo without the -i switch and it will run properly
$ sudo ./ruby-test.rb Arg0 'Arg Num1' Arg2

Arg 0: Arg0
Arg 1: Arg Num1
Arg 2: Arg2

3. Now execute with sudo -i

$ sudo -i ~mhanby/tmp/ruby-test.rb Arg0 'Arg Num1' Arg2
Arg 0: Arg0
Arg 1: Arg
Arg 2: Num1
Arg 3: Arg2

Actual results:
the 2nd argument is a string containing a space, when run with -i this is getting split into multiple arguments

Expected results:
arguments with spaces surrounded by quotes should be treated as a single argument.

Additional info:
Something changed from sudo-1.7.2p1-14.el5_8 to sudo-1.7.2p1-14.el5_8.2 that is causing this behavior.
Comment 4 RHEL Product and Program Management 2013-05-01 02:47:12 EDT
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.

Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.
Comment 8 RHEL Product and Program Management 2013-05-20 12:44:35 EDT
This request was evaluated by Red Hat Product Management for
inclusion in a Red Hat Enterprise Linux release.  Product
Management has requested further review of this request by
Red Hat Engineering, for potential inclusion in a Red Hat
Enterprise Linux release for currently deployed products.
This request is not yet committed for inclusion in a release.
Comment 17 errata-xmlrpc 2013-09-30 20:28:30 EDT
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-1353.html

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