[Portland] xdg-su syntax

Bastian, Waldo waldo.bastian at intel.com
Tue Jul 11 13:44:16 PDT 2006


>On Mon, Jul 10, 2006 at 10:11:07PM -0700, Bastian, Waldo wrote:
>> >> Hi,
>> >>
>> >> It was suggested to me that it would be better for xdg-su to
follow
>> the
>> >> "sudo"-syntax rather than the "su -c" syntax because it has less
>> >> potential for getting the shell escaping wrong.
>> >> For illustration, to run "rpm -i '/tmp/some file'" as root the
>> current
>> >> syntax is:
>> >> 	xdg-su -c "rpm -i '/tmp/some file'"
>> >>
>> >> The new proposed syntax would be:
>> >> 	xdg-su rpm -i "/tmp/some file"
>> >>
>> >> The drawback seems to be that if you want to do a shell command
like
>> >> "cd /tmp; rpm -i 'some file'" you will still end up with
>> >> 	xdg-su sh -c "cd /tmp; rpm -i 'some file'"
>> >>
>> >> Opinions?
>> >
>> >Would this work as well?
>> >
>> >	xdg-su "cd /tmp && rpm -i 'some file'"
>>
>> That would need to be
>> 	xdg-su sh -c "cd /tmp && rpm -i 'some file'"
>
>Hrm, seems a rather cumbersome syntax.

Well.. the alternative is
	xdg-su -c "cd /tmp && rpm -i 'some file'"
which is not that much of a change. I guess we can also support both.

Cheers,
Waldo


More information about the Portland mailing list