Strange Xsession behavior with XDMCP server (A bug?)



Hi.
I just noticed something strange with GDM's /etc/gdm/Xsession.

I am using GDM 2.6.0.5 and I tried to set it up to accept XDMCP
connections from other X Servers. When a connection from an X Terminal
comes in and GDM starts logging the user in, the $DISPLAY variable in
Xsession is not saved before sourcing /etc/profile, which changes the
$DISPLAY variable to :0, even though it was correctly set up before by
GDM to reflect the address of the remote X Terminal. As a result, the
following error can be seen in ~/.xsession-errors and the session
startup fails:

/etc/gdm/PreSession/Default: Registering your session with wtmp and utmp
/etc/gdm/PreSession/Default: running: /usr/bin/X11/sessreg -a -w /var/log/wtmp -u /var/run/utmp -x "/var/lib/gdm/vega:0.Xservers" -h
"vega" -l "vega:0" "val"
/etc/gdm/Xsession: Beginning session setup...
stderr is not a tty - where are you?
/etc/gdm/Xsession: Setup done, will execute: /usr/bin/ssh-agent -- gnome-session
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified


(gnome-session:1162): Gtk-WARNING **: cannot open display:


The code responsible for this in Xsession is:

# First read /etc/profile and .profile
test -f /etc/profile && . /etc/profile
test -f "$HOME/.profile" && . "$HOME/.profile"
# Second read /etc/xprofile and .xprofile for X specific setup
test -f /etc/xprofile && . /etc/xprofile
test -f "$HOME/.xprofile" && . "$HOME/.xprofile"

For now I corrected it as follows:

SAVED_DISPLAY=$DISPLAY

# First read /etc/profile and .profile
test -f /etc/profile && . /etc/profile
test -f "$HOME/.profile" && . "$HOME/.profile"
# Second read /etc/xprofile and .xprofile for X specific setup
test -f /etc/xprofile && . /etc/xprofile
test -f "$HOME/.xprofile" && . "$HOME/.xprofile"

DISPLAY=$SAVED_DISPLAY

After this change I can log in from my X Terminal successfully.

Is this a bug? Am I missing something?

Thanks.

-- 
Val <vblant shaw ca>

Attachment: signature.asc
Description: This is a digitally signed message part



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]