"gksu -u other_user .." is broken

Bug #1242975 reported by xor
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
gksu (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I did this test run with Lubuntu 13.10 amd64 and Xubuntu 13.10 amd64 in separate VMs.

Steps to reproduce:
- Install fresh Lubuntu/Xubuntu
- Open the XFCE terminal.
- Type "sudo -i", enter password, and do the following:
# create a secondary useraccount
adduser testuser
# use nano or your favorite editor:
nano /etc/sudoers.d/testuser
     # allow your main useraccount to execute ANY commands as the "testuser" user using sudo. password will NOT be required
     your_main_username ALL=(testuser) NOPASSWD: ALL
     # save the file.
# set permissions of sudoers.d correctly
chmod 440 /etc/sudoers.d/*

- now open a shell as your main user, NOT as root. do:
gksudo -u testuser xfce4-terminal

This should open a terminal logged in as "testuser". But it does nothing.
Add the debug option and pipe to less to view what happens: "gksudo -du testuser xfce4-terminal 2>&1 | less"
Output:
No ask_pass set, using default!
xauth: /tmp/libgksu-wPttP0/.Xauthority
STARTUP_ID: gksudo/xfce4-terminal/2799-0-xubuntu1_TIME2139054
cmd[0]: /usr/bin/sudo
cmd[1]: -H
cmd[2]: -S
cmd[3]: -p
cmd[4]: GNOME_SUDO_PASS
cmd[5]: -u
cmd[6]: testuser
cmd[7]: --
cmd[8]: xfce4-terminal
buffer: -No protocol specified-
buffer: --
buffer: -(xfce4-terminal:2802): Gtk-WARNING **: cannot open display: :0.0-
buffer: --
buffer: --
buffer: --
buffer: --
buffer: --
buffer: --
(a lot more of the previous messages)
brute force GNOME_SUDO_PASS ended...
No password prompt found; we'll assume we don't need a password.
xauth: /tmp/libgksu-wPttP0/.Xauthority
xauth_env: /home/xor/.Xauthority
dir: /tmp/libgksu-wPttP0

The fact that there is output of xfce4-terminal BEFORE gksudo talks about password, .Xauthority, etc. might indicate that it tries to run the child application too early? I haven't read the source code though, please validate this claim by reading it.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gksu (Ubuntu):
status: New → Confirmed
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.