vncserver bug and patch

Ian Phillipps Ian_Phillipps "at" yahoo.co.uk
Fri, 21 Sep 2001 11:32:38 +0000


I've just upgraded my Linux and found that vncserver stopped working.
The problem is that the "vncserver" perl script fails if the environment
variable XAUTHORITY is set - it overrides the setting when running xauth
and the X server, but fails to do this for the stuff in .vnc/xstartup. I
ran into this when I ran vncserver from an ssh session with X forwarding
turned on. My copy of ssh (OpenSSH_2.9p1, SSH protocols 1.5/2.0, OpenSSL
0x0090601f) sets XAUTHORITY to its own cookie file.

The patch below cures the problem for me; it allows .vnc/xstartup to run
but I can't think of a "general" solution for this case. Maybe a warning
is appropriate if $ENV{XAUTHORITY} is found to be set, since this is
going to cause confusion. My solution means an x client cannot be
started from the command line after vncserver, without overriding the
ENV variable.

Allowing the setting of XAUTHORITY to stand doesn't work either; I don't
suppose that (to take my present case) /tmp/ssh-XX3RIPvB/cookies will
remain after my ssh session finishes.

BTW, the lack of permissions on /tmp/.X11-unix bit me on Slackware 8.0

Ian

*** vncserver.orig	Thu Oct 26 16:16:37 2000
--- vncserver	Thu Sep 20 16:40:18 2001
***************
*** 39,42 ****
--- 39,43 ----
  $vncUserDir = "$ENV{HOME}/.vnc";
  $xauthorityFile = "$ENV{HOME}/.Xauthority";
+ $ENV{XAUTHORITY} = $xauthorityFile;
  
  $defaultXStartup

-- 
    I am confident this explanation will dispell any feelings
    of certainty that may have been troubling you.
     - BWHOLMES "at" SJSUVM1.sjsu.edu (Cabbage) in <9601221753.AA27669 "at" spock>
---------------------------------------------------------------------
To unsubscribe, send a message with the line: unsubscribe vnc-list
to majordomo "at" uk.research.att.com
See also: http://www.uk.research.att.com/vnc/intouch.html
---------------------------------------------------------------------