FS#31720 - [util-linux] Cannot running GUI Application from "su -l" and "gksu -l"

Attached to Project: Arch Linux
Opened by miraclex (miraclex) - Friday, 28 September 2012, 16:17 GMT
Last edited by Dave Reisner (falconindy) - Friday, 28 September 2012, 22:29 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Dave Reisner (falconindy)
Tom Gundersen (tomegun)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 4
Private No

Details

Description:
===============================================================================
Cannot running any GUI applications as root from "su -l" and "gksu -l"


Additional info:
===============================================================================
Package : util-linux 2.22-6
Programs : su, gksu
Topic discussion : https://bbs.archlinux.org/viewtopic.php?id=149534


Steps to reproduce:
===============================================================================
Example 1 :
$ su -
# gparted

Example 2 :
$ gksu -l thunar
"Thunar: Cannot open display:"
This task depends upon

Closed by  Dave Reisner (falconindy)
Friday, 28 September 2012, 22:29 GMT
Reason for closing:  Not a bug
Additional comments about closing:  Working as described by the manual.
Comment by azzka (azzka) - Friday, 28 September 2012, 17:15 GMT
Maybe it could be useful to read this http://ubuntuforums.org/showpost.php?p=11905175&postcount=6 .
AFAIK you're not supposed to run GUI programs as root but here ( http://forums.opensuse.org/english/get-technical-help-here/applications/476775-cannot-open-gui-programs-root.html ) and here ( http://www.unix.com/man-page/OpenSolaris/1/gksu/ ) it seems you can with gksu.
AFAIK you should do "gksu thunar", maybe I'm wrong.
Also I cannot test it, just suggesting.
Comment by David Batson (David_Batson) - Friday, 28 September 2012, 18:28 GMT
Just to add my 2 cents worth. "$ su -" has always worked for me to open gui text editors and gui file managers from Arch XFCE, to Fedora 17 Gnome, to Mageia 2 KDE as a regular user. Only after the last round of updates in Arch does "$ su -" not open these items anymore in Arch XFCE (in my case with gedit and thunar). Found "$ gksu" and "$ sudo" does work though.

Since I have discovered a couple of workarounds for Arch XFCE, it's not real important to me that this gets fixed, but it would be nice for consistancy sake... As I stated above, "$ su -" used to open these applications up until a couple of weeks ago in Arch XFCE."
Comment by Gerardo Exequiel Pozzi (djgera) - Friday, 28 September 2012, 19:04 GMT
This is the right behaviour. See su(1) manpage. Previous "su" works because was included a patch for coreutils to make pam-compliant, that apart from other things, preserves $DISPLAY and $XAUTHORITY.
Comment by miraclex (miraclex) - Friday, 28 September 2012, 21:34 GMT
Ok, this is not a bug, just a new behaviour.
Thank you, djgera.

Ok, running gui apps as root from "su -l" is works :
Example:
$ su -
# export DISPLAY=:0.0
# gparted

But running gui apps as root from "gksu -l" is impossible.
Please explain me what the use of "gksu -l <gui app>" ?

Thank you.
Comment by miraclex (miraclex) - Friday, 28 September 2012, 21:46 GMT
Ok, I can run gui apps as root from "gksu -l"

Example :
$ gksu -l "export DISPLAY=:0.0; gparted"

What do you think about it ? Is this default behaviour now ?
If this is default behaviour,
I can't understand why there is "gksu -l" but you must export $DISPLAY to running any gui apps.
Comment by Gerardo Exequiel Pozzi (djgera) - Friday, 28 September 2012, 21:56 GMT
See gtksu(1) manpage ;)

"--login, -l Make this a login shell. Beware this may cause problems with the Xauthority magic. Run xhost to allow the target user to open windows on your display!"
Comment by miraclex (miraclex) - Friday, 28 September 2012, 21:59 GMT
@djgera
I understand,
but really I can't understand why there is "gksu -l" but you must export $DISPLAY to running any gui apps.

Loading...