Bug 439074

Summary: X11 apps can not run as root over a user's session
Product: [openSUSE] openSUSE 11.1 Reporter: Carlos Robinson <carlos.e.r>
Component: X11 ApplicationsAssignee: Hans Petter Jansson <hpj>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P3 - Medium CC: dimstar, gp, kontakt, o.nicolas
Version: Factory   
Target Milestone: ---   
Hardware: Other   
OS: SUSE Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Carlos Robinson 2008-10-26 18:58:01 UTC
OS: 11.1 Beta 3 - not in the list

*Warning*: This NOT Bug 437411  (why: read to the end)


Description (tested in Gnome):

Log in. Do "su -". Try to run a test mode app, see that it works. 
Now try a graphical tool: doesn't run.

Examples:

 "yast --qt" runs in ncurses mode.

gconf-editor or gedit do not run:

(gedit:5290): Gtk-WARNING **: cannot open display: 


minas-morgul:~ # gconf-editor
Cannot open display:
Run 'gconf-editor --help' to see a full list of available command line
options.

-------- trying sux

cer@minas-morgul:~> xhost +localhost
localhost being added to access control list
cer@minas-morgul:~> sux -
Password:
minas-morgul:~ # gconf-editor
Cannot open display:
Run 'gconf-editor --help' to see a full list of available command line
options.

------- using xhost and su -

cer@minas-morgul:~> xhost +localhost
localhost being added to access control list
cer@minas-morgul:~> set | grep DISPLAY
DISPLAY=:0.0
cer@minas-morgul:~> su -
Password:
minas-morgul:~ # set | grep DISPLAY
minas-morgul:~ # export DISPLAY=:0.0
minas-morgul:~ # gconf-editor
Invalid MIT-MAGIC-COOKIE-1 keyCannot open display:
Run 'gconf-editor --help' to see a full list of available command line
options.
minas-morgul:~ # set | grep DISPLAY
DISPLAY=:0.0
minas-morgul:~ #

 ------- Via ssh

cer@minas-morgul:~> ssh -X root@localhost
The authenticity of host 'localhost (::1)' can't be established.
RSA key fingerprint is 44:3e:9c:f0:65:63:34:5c:52:73:97:f0:b9:31:3c:ae.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'localhost' (RSA) to the list of known hosts.
Password:
Warning: No xauth data; using fake authentication data for X11 forwarding.
Last login: Sat Oct 25 17:05:31 2008 from console
Have a lot of fun...
minas-morgul:~ # gconf-editor
Invalid MIT-MAGIC-COOKIE-1 keyCannot open display:
Run 'gconf-editor --help' to see a full list of available command line
options.
minas-morgul:~ # set | grep DISPLAY
DISPLAY=localhost:10.0
minas-morgul:~ #


This NOT Bug 437411 because I have no pam_fp in in any pam.d/* file.

More symptoms: 

  There are no text mode consoles.
  
  Updates are not available via YOU.
Comment 1 Gerald Pfeifer 2008-10-27 11:22:49 UTC
Use "su" instead of "su -", and it should work.  At least, it does for me.
Comment 2 Dominique Leuenberger 2008-10-27 12:22:48 UTC
this would most likely be a dup of #428118
Comment 3 Carlos Robinson 2008-10-27 12:36:44 UTC
(In reply to comment #2 from Dominique Leuenberger)
> this would most likely be a dup of #428118
> 

Certainly it looks so; however, Bug 428118 is closed as resolved, and as Beta3 has the same problem, it is not solved.
Comment 4 Dominique Leuenberger 2008-10-27 13:00:18 UTC
then bug #437296 is also related.

there was a gdm patch post b3, which supposedly fixes it (it did not for me).
Comment 5 Dominique Leuenberger 2008-10-30 12:29:49 UTC
factory update fixed this issue on my side now.

What about you Carlos?
Comment 6 Carlos Robinson 2008-10-30 14:40:12 UTC
(In reply to comment #5 from Dominique Leuenberger)
> factory update fixed this issue on my side now.
> 
> What about you Carlos?
> 

Sorry, I can not run any tests, because "zypper dup" has been having problems all week :-(

See factory list...

My last status is comment 30 to bug #437296
Comment 7 Carlos Robinson 2008-11-01 13:23:20 UTC
Ok, now I have:

cer@minas-morgul:~> cat /etc/SuSE-release 
openSUSE 11.1 Beta 4 (i586)
VERSION = 11.1

cer@minas-morgul:~> cat /etc/SuSE-brand 
openSUSE
VERSION = 11.0

cer@minas-morgul:~> l /etc/SuSE-*
-rw-r--r-- 1 root root 24 2008-10-24 02:02 /etc/SuSE-brand
-rw-r--r-- 1 root root 43 2008-10-30 16:00 /etc/SuSE-release

I doubt I have beta4, because dup finished under an hour, a moment ago, but...

Ok. I do have text consoles back.

Not Ok, I still can not run apps as root under gnome:

minas-morgul:~ # yast2
No protocol specified

(y2controlcenter-gnome:4929): Gtk-WARNING **: cannot open display: :0.0
minas-morgul:~ # gedit
No protocol specified

(gedit:4931): Gtk-WARNING **: cannot open display: :0.0
minas-morgul:~ # 


Comment 8 Olivier Nicolas 2008-11-05 22:12:06 UTC
cat /etc/SuSE-release 
openSUSE 11.1 Beta 4 (x86_64)
VERSION = 11.1


test@am2:~> xauth -v list
Using authority file /var/run/gdm/auth-for-test-N9k5TU/database
localhost/unix:0  MIT-MAGIC-COOKIE-1  43b23451e4a1bedf4a3d3fb1c068743c
test@am2:~> su -
Password: 
am2:~ # echo $DISPLAY
:0.0
am2:~ # xauth -v list
Using authority file /root/.xauthXwzNeK
localhost/unix:0  MIT-MAGIC-COOKIE-1  43b23451e4a1bedf4a3d3fb1c068743c
am2:~ # gedit 
No protocol specified

(gedit:11701): Gtk-WARNING **: cannot open display: :0.0




Comment 9 Andreas Jaeger 2008-11-10 17:59:32 UTC
Works fine for me - perhaps some GNOME problem?

Stefan, any ideas?
Comment 10 Stefan Dirsch 2008-11-10 18:04:25 UTC
Yes, Gnome problem.
Comment 11 Jakub Rusinek 2008-12-21 11:58:58 UTC
Strange. I can't use sudo for X apps, although I modified sudoers on my own to make it keep some environment's vars.
Comment 12 Dominique Leuenberger 2009-06-17 08:45:20 UTC
Carlos, I was wondering if you actually see this in GM of 11.1. I did not read / see any reports and as such I believe this was solved (I could not reproduce it on my 11.1 box... the two others have been long on Factory again).

Do you have the option to test it?
Comment 13 Carlos Robinson 2009-06-24 18:11:52 UTC
(In reply to comment #12)
> Carlos, I was wondering if you actually see this in GM of 11.1. I did not read
> / see any reports and as such I believe this was solved (I could not reproduce
> it on my 11.1 box... the two others have been long on Factory again).
> 
> Do you have the option to test it?

Er... not at the moment, no free time. I'm using 11.0 due to s2disk not powering off the computer (reported, not solved). Perhaps next week I'll be able to try (postit written).
Comment 14 Hans Petter Jansson 2011-01-11 16:02:58 UTC
I'm fairly certain this bug was fixed a long time ago.

I tested "yast --qt" under "su", "su -" and "sudo" on both 11.2 and pre-11.4. All of them work, but for sudo you need to specifically set the DISPLAY variable, e.g. "sudo DISPLAY=$DISPLAY /sbin/yast --qt".

Closing as fixed - please reopen if the problem persists for you on newer versions of openSUSE.