command chaining with "&&" doesn't work AS IT strips one level of quoting
Bug #157043 reported by
Origaman
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
kdesudo (Ubuntu) |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Binary package hint: kdesudo
On Feisty, with kdesu I was able to use it to execute two or more commands in a row without repeatedly being asked for a password by chaining them like this: kdesu "command1 && command2 && ...".
With kdesudo, this isn't working any more. Only the first command is executed with root privileges, all further commands with normal user privileges.
Related branches
Changed in kdesudo: | |
importance: | Undecided → Medium |
status: | New → Confirmed |
Changed in kdesudo: | |
status: | Confirmed → Fix Committed |
To post a comment you must log in.
That this ever worked in kdesu was a bug IMHO. kdesudo (kdesu is now a link to it)
Here's why
sudo "id && whoami" -> sudo: id && whoami: command not found
Even su complain. To do what you want with su one has to use
su -c "comamnd1 && command2"
There is a -c (pass to shell) command. As su always asked for a password, implementing - c was
is necessary. Sudo does not ask the second time, so sudo command1 && sudo command is the
natural thing.
Task of kdesu and kdesudo is run a/one command as root. Not to emulate part of the shell (aka
implement &&).
As sudo does not have -c and su used it for &&, || etc task. I would suggest that this is the right
fix. Don't reimplement kdesu's non unixish behaviour.