sudo -i invalid escaping

Bug #893235 reported by Tuomas Silen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
sudo (Ubuntu)
New
Undecided
Unassigned

Bug Description

Ubuntu release: 11.04
Sudo package: 1.7.4p4-5ubuntu7.1

Current sudo version escapes commands so that they can never match anything in sudoers when using -i parameter (login shell).

What is expected (happens in 1.7.2 (ie. Ubuntu 10.04) and 1.7.5):

sudoers:
Cmnd_Alias COMMAND=/bin/bash -c /foo/bar/test.sh

command:
$ sudo -i /foo/bar/test.sh

sudo sees the command like this:
COMMAND=/bin/bash -c /foo/bar/test.sh

And the command matches the rule in sudoers and is executed.

What happens instead:
When running
$ sudo -i /foo/bar/test.sh

the command fails because it doesn't match anything in sudoers, because sudo escapes the command to this:
COMMAND=/bin/bash -c \/foo\/bar\/test\.sh

and that won't match the command in sudoers because of the backslashes. It is also not possible to make similar escaping in sudoers file as you get syntax error.

I couldn't find any workaround for this, so it seems to be quite critical. The fix should probably be backported from sudo 1.7.5.

See sudo bug #451 http://www.sudo.ws/sudo/bugs/show_bug.cgi?id=451

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.