Comment 3 for bug 218231

Revision history for this message
Oliver Grawert (ogra) wrote :

--- scripts/add_fstab_entry 2008-01-11 00:37:11.000000000 +0100
+++ scripts/add_fstab_entry.new 2008-04-17 22:07:09.000000000 +0200
@@ -28,10 +28,25 @@

 # Mount in the client session, if logged in.
 for LDM_SOCKET in /var/run/ldm_socket_*; do
+ SSH_OPTS="-X"
     SERVER=${LDM_SOCKET##*_}
     if [ -S ${LDM_SOCKET} ]; then
+ # see if we have a command with DISPLAY matching our socket
+ IS_DIRECTX=$(pgrep -f -l DISPLAY |grep ${LDM_SOCKET})
+
+ unset DISPLAY_INFO
+ # get the DISPLAY info for ltspfsmounter
+ if [ -n "${IS_DIRECTX}" ];then
+ unset SSH_OPTS
+ for line in $IS_DIRECTX; do
+ if [ -n "$(echo $line|grep DISPLAY)" ]; then
+ DISPLAY_INFO="${line}"
+ fi
+ done
+ fi
+
         # ltspfs needs access to the X display
- /usr/bin/ssh -X -S ${LDM_SOCKET} ${SERVER} \
- "/usr/sbin/ltspfsmounter ${MOUNTPOINT} add"
+ /usr/bin/ssh $SSH_OPTS -S ${LDM_SOCKET} ${SERVER} \
+ "$DISPLAY_INFO /usr/sbin/ltspfsmounter ${MOUNTPOINT} add"
     fi
 done