using gksu to run an X program as a different user other than root is broken

Bug #48265 reported by Bjorn Hansen
This bug report is a duplicate of:  Bug #47388: gksuexec doesn't work in dapper !. Edit Remove
12
Affects Status Importance Assigned to Milestone
gksu (Ubuntu)
Invalid
Medium
Unassigned

Bug Description

say I am logged in as user1. At a command prompt I type:
$ su user2 somecommand
and at the password prompt user2's password must be entered.
But if I type:
$ gksu -u user2 somecommand
and enter user2's password, I get:
GNOME_SUDO_PASS
sudo: 1 incorrect password attempt
and a pop up box telling me "Wrong password." However, if I enter user1's password it proceeds and runs the command. This is very wrong behavior IMHO.

I gather this is because gksudo has been patched to use sudo as backend authentication, equivalent to (?) using the --sudo-mode flag in the unpatched version. according to the man page:
 --sudo-mode, -S

              Use sudo instead of su as backend authentication system. Notice
              that the X authorization magic will not work when using sudo for
              target users other than root.

and therin lies the problem; the X authorization magic is broken.

For correct behavior, if I am logged in as user1 and user2 wants to run say, their mail program, without logging out and loging into their own desktop, they should be able to type 'gksudo -u user2 mailprogram' and have it work (this used to work in previous versions)

Revision history for this message
Sebastian Heinlein (glatzor) wrote :

firstly gksu now defaults to the sudo mode.

so you would like to see this changed?

secondly there is a bug in gksu using a wrong path for xauth.

Changed in gksu:
status: Unconfirmed → Needs Info
Revision history for this message
Bjorn Hansen (holomorph) wrote :

I think it's ok if it defaults to sudo mode, but the man page should reflect this, and there should be a way to get the other behavior (eg an --su-mode flag). Is this possible?

On the other hand it seems a bit silly to have it default to sudo mode, since there is also a 'gksudo' command.

Revision history for this message
Sebastian Heinlein (glatzor) wrote :

Ubuntu doesn't use a root login. So a gksu that is by default in sudo mode provides compatibility with systems that use a root login.

There is an option in gconf: /apps/gksu/sudo-mode

Revision history for this message
Bjorn Hansen (holomorph) wrote :

I think it's ok if it defaults to sudo mode, but the man page should reflect this, and there should be a way to get the other behavior (eg an --su-mode flag). Is this possible?

On the other hand it seems a bit silly to have it default to sudo mode, since there is also a 'gksudo' command.

Revision history for this message
Bjorn Hansen (holomorph) wrote :

sorry, accidentally refreshed the page which caused the duplicate post. . .

Revision history for this message
Bjorn Hansen (holomorph) wrote :

ok, so it appears that not using sudo mode by default would be bad since gksudo is just a shortcut to gksu:
lrwxrwxrwx 1 root root 4 2006-05-13 01:03 /usr/bin/gksudo -> gksu

It would be nice if they were actually different, where gksudo would use sudo mode, and gksu would not (especially if the bug w/ the xauth stuff were to get fixed with gksu)

Revision history for this message
Christophe Charlot (c-charlot) wrote :

this looks like a duplicate of bug #47388, no ?

Revision history for this message
towsonu2003 (towsonu2003) wrote :

closing as this is a duplicate.

Changed in gksu:
status: Needs Info → Rejected
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.