gksu gets confused when & is used in command (expects entity!)

Bug #133639 reported by Fernando Miguel
16
Affects Status Importance Assigned to Milestone
libgksu (Ubuntu)
Fix Released
Undecided
Michael Vogt

Bug Description

Binary package hint: gksu

I'm having this problem with Gutsy.
Its asking me for the root password for anything that uses GKSU / GKSUDO instead of the user admin's pass.

all other tickets are quite old.

Related branches

Revision history for this message
Cesare Tirabassi (norsetto) wrote :

I tried some applications (synaptic included) that use gksu/gksudo and they are all showing an "enter your password to perform administrative tasks" prompt.
Is this the case for you as well?
What do you mean by "asking for the root password"?

Changed in gksu:
status: New → Incomplete
Revision history for this message
Fernando Miguel (fernandomiguel) wrote :

Hy.
I'm getting a box, asking me for the administrative pass.
It also allows me to save the password for the session or in the keyring.
I've set a different password for both root, and my admin user, and thats why I've found out that it was asking the root password, because it wouldnt accept my regular admin pass.

PS: i'm using gnome recovery session, because of some yet unknown problem that when login in into regular gnome session, sends me to a gnome-terminal console.

Revision history for this message
Cesare Tirabassi (norsetto) wrote :

Well, this is the normal behaviour. Its the same if you try to run a CLI application by using sudo, the password asked is that of your root user.

Perhaps this wiki page will clarify it for you:

https://help.ubuntu.com/community/RootSudo

On the base of this, I'm marking this bug as invalid (its not a bug but the normal behaviour). Please let us know if you disagree or you need any other clarifications.

Thanks.

Changed in gksu:
status: Incomplete → Invalid
Revision history for this message
Fernando Miguel (fernandomiguel) wrote :

well, it always asked me for my admin pass and never the root's
It just started happening this weekend, so there is a reason for me to think of it as a bug, right?
Whenever I open synaptic it should ask for my pass, and I can repetadly get to insert the root's password.
Cant this be a bug on the last batch of gutsy updates?

Revision history for this message
Cesare Tirabassi (norsetto) wrote :

You might be right. Indeed in the sudo manual it states:

...sudo requires that users authenticate themselves with a password...
(NOTE: in the default configuration this is the user's password, not the root password)

I'm therefore reopening it and marking it as confirmed.

Changed in gksu:
status: Invalid → Confirmed
Revision history for this message
Fernando Miguel (fernandomiguel) wrote : Re: [Bug 133639] Re: synaptic is asking root password and not user admin's

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

thanks
On Monday 20 August 2007 17:04:48 Cesare Tirabassi wrote:
> You might be right. Indeed in the sudo manual it states:
>
> ...sudo requires that users authenticate themselves with a password...
> (NOTE: in the default configuration this is the user's password, not the root password)
>
> I'm therefore reopening it and marking it as confirmed.
>
> ** Changed in: gksu (Ubuntu)
> Status: Invalid => Confirmed
>

- --
BUGabundo :o)
(``-_-´´) http://Ubuntu.BUGabundo.net
Linux user #443786 GPG key 1024D/A1784EBB
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGyeEQY5ijS6F4TrsRAuGFAJkBlf6Y9OJ7A+kagwmaoXEfV9OllACgkA3c
WP17ohYecszNCgt7aeCs78c=
=ggcf
-----END PGP SIGNATURE-----

Revision history for this message
Daniel Hahler (blueyed) wrote : Re: synaptic is asking root password and not user admin's

This seems to happen, if there's a "&&" in the command that should be run:
The following asks for the administrative password:
sudo -k; gksudo "true; true"

But this asks for the root password:
sudo -k; gksudo "true && true"

Revision history for this message
Fernando Miguel (fernandomiguel) wrote :

I finally fixed using:
#gksu-properties
and changing it from SU to SUDO.
It has to be done both by the user and root, so:
$gksu-properties;
$sudo gksu-properties;

Revision history for this message
Daniel Hahler (blueyed) wrote : Re: [fixed] synaptic is asking root password and not user admin's

BUGabundo, this appears not to be the "real fix".

The problem is, that gksu gets confused by an existing "&".

It expects an HTML entity, when an ampersand gets used.

Try:
$ LANG=C gksu '&'

(gksu:31720): Gtk-WARNING **: Failed to set text from markup due to error parsing markup: Error on line 3: Character ''' is not valid at the start of an entity name; the & character begins an entity; if this ampersand isn't supposed to be an entity, escape it as &

The following display the correct dialog, but fails when being executed:
gksu "sh -c 'echo 1 && echo 2'"

The Gtk-WARNING seems to be the cause/hint, why an inappropriate dialog gets used.

Daniel Hahler (blueyed)
Changed in gksu:
assignee: nobody → blueyed
status: Confirmed → In Progress
Revision history for this message
Daniel Hahler (blueyed) wrote :

I've found the bug and reported it upstream: https://savannah.nongnu.org/bugs/index.php?21052

I'll attach a debdiff for Gutsy.

Changed in gksu:
assignee: blueyed → nobody
status: In Progress → Confirmed
Revision history for this message
Daniel Hahler (blueyed) wrote :

Please don't upload yet. I'll provide a new debdiff in a minute and also address bug #103406 in it.

Revision history for this message
Daniel Hahler (blueyed) wrote :

Please verify and upload it.

Revision history for this message
Daniel Holbach (dholbach) wrote :

Michael: can you please take a look at this one?

Changed in libgksu:
assignee: nobody → mvo
Revision history for this message
Michael Vogt (mvo) wrote :

Thanks a lot for the fix! I just uploaded the new version.

Changed in libgksu:
status: Confirmed → Fix Released
Revision history for this message
Daniel Hahler (blueyed) wrote :

libgksu (2.0.5-1ubuntu4) gutsy; urgency=low

  * debian/patches/18_g_markup_escape_text_for_command.patch:
    Escape markup in dialog's command substitutions (LP: #133639)
    Fix order of user and command in a message (LP: #103406)

 -- dAniel hAhler <email address hidden> Wed, 12 Sep 2007 23:48:50 +0200

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.