[X2Go-Commits] [x2goserver] 01/02: Use more quotes in x2goruncommand.

git-admin at x2go.org git-admin at x2go.org
Mon Jun 30 12:51:39 CEST 2014


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch release/4.0.1.x
in repository x2goserver.

commit 2482af829c7fd73ec0ed7e6f12d97f0d88b49e24
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Mon Jun 30 12:44:49 2014 +0200

    Use more quotes in x2goruncommand.
---
 debian/changelog              |    1 +
 x2goserver/bin/x2goruncommand |   50 ++++++++++++++++++++++-------------------
 2 files changed, 28 insertions(+), 23 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 4384a31..fd13717 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -48,6 +48,7 @@ x2goserver (4.0.1.16-0x2go1) UNRELEASED; urgency=low
       are still running/suspended during package upgrade.
     - Provide support for client-side choice of clipboard security. (Fixes:
       #524).
+    - Use more quotes in x2goruncommand.
   * debian/control, x2goserver.spec:
     + Update versioned D: x2goagent (>= 3.5.0.25). This assures that X2Go
       works with poly-instantiated /tmp directories.
diff --git a/x2goserver/bin/x2goruncommand b/x2goserver/bin/x2goruncommand
index eedf59d..3e8dfab 100755
--- a/x2goserver/bin/x2goruncommand
+++ b/x2goserver/bin/x2goruncommand
@@ -21,15 +21,15 @@
 # Copyright (C) 2007-2014 Heinz-Markus Graesing <heinz-m.graesing at obviously-nice.de>
 
 DISPLAY=":$1"
-X2GO_AGENT_PID=$2
-X2GO_SESSION=$3
-cmd=$5
-sndsys=$6
-X2GO_SESS_TYPE=$7
+X2GO_AGENT_PID="$2"
+X2GO_SESSION="$3"
+cmd="$5"
+sndsys="$6"
+X2GO_SESS_TYPE="$7"
 
 X2GO_LIB_PATH="$(x2gopath libexec)";
 
-$X2GO_LIB_PATH/x2gosyslog "$0" "info" "$(basename $0) called with options: $@"
+"$X2GO_LIB_PATH/x2gosyslog" "$0" "info" "$(basename $0) called with options: $@"
 
 export DISPLAY
 export X2GO_AGENT_PID
@@ -48,22 +48,22 @@ export NX_XINERAMA_CONF
 test -n $KRB5CCNAME && export KRB5CCNAME
 
 # disable rastering in >= KDE4.8 and Qt4.8
-export QT_GRAPHICSSYSTEM=native
+export QT_GRAPHICSSYSTEM="native"
 
 IMEXIT="false"
 
-NX_XINERAMA_LIBS=$(x2gopath xinerama)
-NX_LIBS=$(x2gopath nx-x11)
+NX_XINERAMA_LIBS="$(x2gopath xinerama)"
+NX_LIBS="$(x2gopath nx-x11)"
 test -n "$LD_LIBRARY_PATH" && \
   LD_LIBRARY_PATH="$NX_XINERAMA_LIBS:$NX_LIBS:$LD_LIBRARY_PATH" || \
   LD_LIBRARY_PATH="$NX_XINERAMA_LIBS:$NX_LIBS"
-$X2GO_LIB_PATH/x2gosyslog "$0" "debug" "exporting LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
+"$X2GO_LIB_PATH/x2gosyslog" "$0" "debug" "exporting LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
 export LD_LIBRARY_PATH
 
 if [ "$sndsys" == "esd" ]; then
-	export ESPEAKER=localhost:$4
+	export ESPEAKER="localhost:$4"
 elif [ "$sndsys" == "arts" ]; then
-	export ARTS_SERVER=localhost:$4
+	export ARTS_SERVER="localhost:$4"
 fi
 
 # detect Ubuntu version via /etc/lsb-release (not supported by Debian)
@@ -155,11 +155,16 @@ elif ([ "$cmd" == "UNITY" ] || [ "$cmd" == "unity" ]); then
 	fi
 	# on earlier Ubuntu versions or with non-Ubuntu Distros the ,,UNITY'' command in X2Go will launch the GNOME2 desktop shell
 
+elif ([ "$cmd" == "CINNAMON" ] || [ "$cmd" == "cinnamon" ]); then
+	cmd="/usr/bin/gnome-session"
+	export DESKTOP_SESSION="cinnamon2d"
+	args=" --session=$DESKTOP_SESSION"
+
 elif [ "$cmd" == "MATE" ]; then
 	cmd="/usr/bin/mate-session"
 elif [ "$cmd" == "KDE" ]; then
 	cmd="/usr/bin/startkde"
-elif [ "$cmd" == "XFCE4" ]; then
+elif [ "$cmd" == "XFCE4" ] || [ "$cmd" == "XFCE" ]; then
 	cmd="/usr/bin/xfce4-session"
 elif [ "$cmd" == "LXDE" ]; then
 	cmd="/usr/bin/startlxde"
@@ -248,29 +253,28 @@ then
 	X2GO_SESS_TYPE="R"
 fi
 
-
 # run x2goserver-extensions for pre-runcommand
 x2gofeature X2GO_RUN_EXTENSIONS &>/dev/null && x2goserver-run-extensions "$X2GO_SESSION" pre-runcommand || true
 
 sucessful_run=false
-if [ "$EXEC" != "" ] && [ -x $EXEC ]; then
-	$X2GO_LIB_PATH/x2gosyslog "$0" "debug" "running command $EXEC"
+if [ "$EXEC" != "" ] && [ -x "$EXEC" ]; then
+	"$X2GO_LIB_PATH/x2gosyslog" "$0" "debug" "running command $EXEC"
 
 	x2gosetkeyboard >/dev/null 2>/dev/null &
 
 	x2gofeature X2GO_XSESSION &>/dev/null && [ "x$X2GO_SESS_TYPE" = "xD" ] && {
 		STARTUP="$cmd$args"
-		$X2GO_LIB_PATH/x2gosyslog "$0" "notice" "launching session with Xsession-x2go mechanism, using STARTUP=\"$STARTUP\""
+		"$X2GO_LIB_PATH/x2gosyslog" "$0" "notice" "launching session with Xsession-x2go mechanism, using STARTUP=\"$STARTUP\""
 		XSESSION_EXEC="$cmd" STARTUP="/usr/bin/env LD_LIBRARY_PATH=${LD_LIBRARY_PATH} ${STARTUP}" /etc/x2go/Xsession
 	} || {
-		$X2GO_LIB_PATH/x2gosyslog "$0" "debug" "executing command \"$cmd$args\"..."
+		"$X2GO_LIB_PATH/x2gosyslog" "$0" "debug" "executing command \"$cmd$args\"..."
 		$EXEC_WRAPPER $cmd$args
 	}
 
 	#### some applications can quit immediately, we will wait here as long as x2goagent exists
 	if [  "$X2GO_SESS_TYPE" == "R" ] && [ "$IMEXIT" == "false" ]; then
-		$X2GO_LIB_PATH/x2gosyslog "$0" "debug" "command $EXEC forked to background, waiting for agent to finish"
-		while [ -d /proc/$X2GO_AGENT_PID ]; do
+		"$X2GO_LIB_PATH/x2gosyslog" "$0" "debug" "command $EXEC forked to background, waiting for agent to finish"
+		while [ -d "/proc/$X2GO_AGENT_PID" ]; do
 			sleep 1
 		done
 	fi
@@ -281,7 +285,7 @@ if [ "$EXEC" != "" ] && [ -x $EXEC ]; then
 	x2gofeature X2GO_RUN_EXTENSIONS &>/dev/null && x2goserver-run-extensions "$X2GO_SESSION" post-runcommand || true
 
 else
-	$X2GO_LIB_PATH/x2gosyslog "$0" "err" "ERROR: command $EXEC failed to execute"
+	"$X2GO_LIB_PATH/x2gosyslog" "$0" "err" "ERROR: command $EXEC failed to execute"
 	echo "X2GORUNCOMMAND ERR NOEXEC:$cmd" > "$MESSAGE_FILE"
 
 	# run x2goserver-extensions for fail-runcommand
@@ -292,8 +296,8 @@ fi
 # stop x2godesktopsharing process gracefully...
 x2gofeature X2GO_DESKTOPSHARING >/dev/null && x2goterminate-desktopsharing "$X2GO_SESSION" || true
 
-kill -TERM  $X2GO_AGENT_PID
-$X2GO_LIB_PATH/x2gochangestatus 'F' "$X2GO_SESSION"  > /dev/null
+kill -TERM  "$X2GO_AGENT_PID"
+"$X2GO_LIB_PATH/x2gochangestatus" 'F' "$X2GO_SESSION"  > /dev/null
 export HOSTNAME
 x2goumount-session "$X2GO_SESSION"
 

--
Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goserver.git


More information about the x2go-commits mailing list