command chaining with "&&" doesn't work AS IT strips one level of quoting

Bug #157043 reported by Origaman
12
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

Revision history for this message
Achim Bohnet (allee) wrote :

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.

Revision history for this message
Achim Bohnet (allee) wrote :

Bug 157733 is the side of the same coin. Marking as duplicate.
Bug is that kdesu/do strips one level of quoting. Breaking with
usual shell parsing behaviour:

kdesudo strips one level of quotes, that makes it unnecessarily complicated
and deviates from sudo behaviour (and FWIW all other command line tools).

  kdesudo kate "one two" # opens 2 files: 'one' and 'two' -> BUG

  sudo kate "one two" # opens the file "one two" as all other commands do

Achim

Frode M. Døving (frode)
Changed in kdesudo:
importance: Undecided → Medium
status: New → Confirmed
Frode M. Døving (frode)
Changed in kdesudo:
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package kdesudo - 2.0-0ubuntu1

---------------
kdesudo (2.0-0ubuntu1) hardy; urgency=low

  * New upstream release :
    - Closes LP: #157043, #162823, #144970, #148255,#172749, #173319
  * Fixed packaging to divert both binary and manpage.

 -- Anthony Mercatante <tonio@kubuntu> Tue, 04 Dec 2007 16:41:58 +0100

Changed in kdesudo:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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