Bug 149789 - Xlib connection failure within vnc session when starting an X11 application after su (run level 3)
Xlib connection failure within vnc session when starting an X11 application a...
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: vnc (Show other bugs)
i686 Linux
medium Severity low
: ---
: ---
Assigned To: Tim Waugh
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2005-02-26 16:18 EST by Neall Doren
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-04-07 08:43:22 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Neall Doren 2005-02-26 16:18:10 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041215 Firefox/1.0 Red Hat/1.0-12.EL4

Description of problem:
Scenario:  Regular user is connected to a VNC server via vncviewer.  The machine running the VNC server is in run level 3 (no X11).  Next, within vnc session, user does an SU to root in an xterm and runs an X11 app, or runs an su graphical application (such as up2date, system-config-users, etc).  Spawn of the X11 window then fails, with an "Xlib" connection xxx refused by server" error.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Server machine must be booted in run level 3, running RHEL 4.
2. User logs into a VNC session running on that server.
3. User runs root app such as up2date or system-config-users, etc.
4. Or, instead of 3, user does an su in an xterm, and runs an X11 app.

Actual Results:  X11 app doesn't start.  Instead, "Xlib: connection xxx refused by server error" occurs.

Expected Results:  X11 app should have created a new window and run.

Additional info:

Problem doesn't occur if machine is booted into run level 5.
Problem occurs only when booted into run level 3.
Problem never occured in previous versions of vnc-server, such as 4.0-0.beta4.1.4
Problem doesn't occur if 4.0-8.1 version of Xvnc is replaced with 4.0-0.beta4.1.4
Problem seems to be due to improper handling of xauth/magic cookies within Xvnc.
Comment 1 Tim Waugh 2005-03-01 09:07:40 EST
I can't reproduce this.  Please provide more information:

1. Have you modified your .vnc/xstartup file?

2. What does '/usr/sbin/getenforce' say?

3. How are you starting VNC?  Running 'vncserver' from the command line or
editing /etc/sysconfig/vncservers (or some other method?)
Comment 2 Neall Doren 2005-03-01 09:43:39 EST
1) $home/.vnc/xstartup slightly modified.  Contents as follows:


# Uncomment the following two lines for normal desktop:
exec /etc/X11/xinit/xinitrc

#[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
#xsetroot -solid grey
#vncconfig -iconic &
#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &

2) /usr/sbin/getenforce returns "Disabled"

3) VNC is started via:  vncserver -geometry 1024x768 :66 (as regular user)


A) Using 4.0-0.beta4.1.4 /usr/bin/Xvnc works perfectly (no other files changed).

B) Using vnc-server-4.0-8.1 /usr/binXlib results in this error (after su, and
within an xterm, inside VNC session):
%root> xterm
connection to "opus:66.0" refused by server
Xlib: No protocol specified
Warning: This program is an suid-root program or is being run by the root user.

C) My default Desktop is KDE, not gnome.  vncserver inits KDE.  NO idea if the
problem exists in gnome.  I don't use twm, fvwm, etc.

D) Clean install of RHEL 4 WS on blank hard drive.  Not upgraded from RHEL 3.

E) Machine boots into run level 3.  Problem disappears in run level 5, or if I
do an "init 5" as root from level 3.
Comment 3 Neall Doren 2005-03-01 09:47:26 EST
Typo in B), in my comment above.  Should read:
B) Using vnc-server-4.0-8.1 /usr/bin/Xvnc results in this error.
Comment 4 Tim Waugh 2005-04-07 08:43:22 EDT
I can't reproduce this.

Fresh install, with KDE added to the package list.
root: Adjust /etc/inittab so that runlevel 3 is default.
root: Add user 'foo'.
foo: Run vncserver -geometry 1024x768 :66
foo: vi .vnc/xstartup and uncomment two indicated lines
foo: vncserver -kill :66
foo: switchdesk KDE
root: reboot
foo: vncserver -geometry 1024x768 :66

Other machine: vncviewer rhel4:66
Main Menu->Run program->"xterm"
In xterm: "su"
root: xterm

Second xterm appears.

Note You need to log in before you can comment on or make changes to this bug.