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

remote development / display environment



Hey guys,

I was fooling around with anaconda over the weekend running on a remote 
machine using X11 port forwarding through SSH.  Everything seems to work
fine except for there is one small bug if you try to run it with root 
priviledges.

I looked through the code and found there is a line which changes the 
Xauth file to point at the wrong place:

if os.environ.has_key('HOME'):
     os.environ['XAUTHORITY'] = os.environ['HOME'] + '/.Xauthority'

..

I've attached a patch which will check to make certain that SSH_TTY isn't 
set in the shell (which should indicate that this is a remote session) 
before reassigning the Xauth path.  It works with OpenSSH but I haven't 
tried it with any other flavours.

--Patrick.

--- anaconda.bak	Mon Jun 30 11:02:39 2003
+++ anaconda	Mon Jun 30 11:09:55 2003
@@ -151,7 +151,7 @@
 signal.signal(signal.SIGINT, signal.SIG_DFL)
 
 # Silly GNOME stuff
-if os.environ.has_key('HOME'):
+if os.environ.has_key('HOME') and not os.environ.has_key('SSH_TTY'):
     os.environ['XAUTHORITY'] = os.environ['HOME'] + '/.Xauthority'
 os.environ['HOME'] = '/tmp'
 os.environ['LC_NUMERIC'] = 'C'

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