Some ThinLinc commands and utilities looks at the DISPLAY environment variable in order to identify the ThinLinc session. prefix.py:get_tl_session_dir()is doing this as a fallback in case TLSESSIONDATA is missing. Others, such as ctccommon.py:get_vnc_port() is using this to determine the RFB port number. Unfortunately, the DISPLAY environment is not reliable for this. It should be treated just for what it is: determining which Xserver to communicate with. Although VSM Agent sets up a DISPLAY which is equal to the TL session number, users are free to modify DISPLAY later. For example, assume that the users runs Xnest, Xvnc or a similar software inside the session. DISPLAY could then be redirected to that Xserver, but the user still wants to be able to use utilities such as tl-mount-localdrives. Another case is of course when DISPLAY is set to another physical workstation or server. Another reason for fixing this bug is that we have parsing code for DISPLAY in several locations, often with bugs (see bug 3797). My suggestion is that for things that needs to use TLSESSIONDATA, I think that TLSESSIONDATA should simply be a requirement, and no DISPLAY fallback should be used. For get_vnc_port() etc, we have at least two options: 1) (again) use and require TLSESSIONDATA, which ends with the session number. 2) introduce a new variable called TLSESSIONNUM or similar.
Another solution: 3) Put a file in $TLSESSIONDATA that specifies the display number. This avoids multiple required environment variables.
(In reply to comment #0) > My suggestion is that for things that needs to use TLSESSIONDATA, I think that > TLSESSIONDATA should simply be a requirement, and no DISPLAY fallback should be > used. Fixed in 29186.
*** Bug 3797 has been marked as a duplicate of this bug. ***
(In reply to comment #1) > Another solution: > > 3) Put a file in $TLSESSIONDATA that specifies the display number. This avoids > multiple required environment variables. Fixed in 29187. The tester should make sure these tools still works: tl-mount-localdrives tl-umount-localdrives tl-serial-redir tl-notify tl-run-rdesktop tl-run-xstartup.d tl-shadow-notify-helper
(In reply to comment #4) > tl-umount-localdrives Works as expected within and outside a valid ThinLinc Session > tl-mount-localdrives Asserts should be performed as early as possible to prevent doing stuff if it's not going to work. This is not the case in tl-mount-localdrives which produces duplicated error message "TLSESSIONDATA is not set. Are you i..." due to call to tl-umount-localdrives before checking if we are in a valid session.
(In reply to comment #4) > tl-serial-redir > tl-notify > tl-run-rdesktop > tl-run-xstartup.d > tl-shadow-notify-helper Each tool above works as expected within and outside a ThinLinc session.
(In reply to comment #5) > (In reply to comment #4) > > tl-umount-localdrives > > Works as expected within and outside a valid ThinLinc Session > > > tl-mount-localdrives > > Asserts should be performed as early as possible to prevent doing stuff if it's > not going to work. This is not the case in tl-mount-localdrives which produces > duplicated error message "TLSESSIONDATA is not set. Are you i..." due to call > to tl-umount-localdrives before checking if we are in a valid session. Fixed in 29397.
(In reply to comment #7) > (In reply to comment #5) > > (In reply to comment #4) > > > tl-umount-localdrives > > > > Works as expected within and outside a valid ThinLinc Session > > > > > tl-mount-localdrives > > > > Asserts should be performed as early as possible to prevent doing stuff if it's > > not going to work. This is not the case in tl-mount-localdrives which produces > > duplicated error message "TLSESSIONDATA is not set. Are you i..." due to call > > to tl-umount-localdrives before checking if we are in a valid session. > > Fixed in 29397. Verified using build 4497. Works as expected.
(In reply to comment #5) > (In reply to comment #4) > > tl-umount-localdrives > > Works as expected within and outside a valid ThinLinc Session > > > tl-mount-localdrives Does not work for me: # tl-umount-localdrives TLSESSIONDATA is not set. Are you in a proper ThinLinc session?
(In reply to comment #9) > (In reply to comment #5) > > (In reply to comment #4) > > > tl-umount-localdrives > > > > Works as expected within and outside a valid ThinLinc Session > > > > > tl-mount-localdrives > > Does not work for me: > > # tl-umount-localdrives > TLSESSIONDATA is not set. Are you in a proper ThinLinc session? r29544.
tl-umount-localdrives -s still requires TLSESSIONDATA.
(In reply to comment #11) > tl-umount-localdrives -s still requires TLSESSIONDATA. Another try in 29547.
This version seems to work as advertised. :)