[X2Go-Commits] x2goserver.git - master (branch) updated: 3.1.1.3-140-g163fb7f

X2Go dev team git-admin at x2go.org
Mon Mar 25 23:59:48 CET 2013


The branch, master has been updated
       via  163fb7f7d7a35a44cda95fd6fb41a1fc574a9133 (commit)
      from  7dae5b7acc8698ac965fb8dfca2950789fe6f5c7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 163fb7f7d7a35a44cda95fd6fb41a1fc574a9133
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Mon Mar 25 23:59:24 2013 +0100

    Break execution of x2gosuspend-session / x2goterminate-session if the script is called without session as first argument and $X2GO_SESSION not set. (Fixes: #82).

-----------------------------------------------------------------------

Summary of changes:
 debian/changelog                     |    3 +++
 x2goserver/bin/x2gosuspend-session   |   15 +++++++++++++--
 x2goserver/bin/x2goterminate-session |   19 +++++++++++++++----
 3 files changed, 31 insertions(+), 6 deletions(-)

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 1d23d81..59fe699 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -34,6 +34,9 @@ x2goserver (4.1.0.0-0~x2go1) UNRELEASED; urgency=low
     + Rely on $PATH when invoking x2gocleansessions.
   * Move code in pre/post+inst/rm scripts around (from x2goserver package
     to libx2go-server-db-perl and x2goserver-common).
+  * Break execution of x2gosuspend-session / x2goterminate-session if the
+    script is called without session as first argument and $X2GO_SESSION
+    not set. (Fixes: #82).
 
   [ Otto Kjell ]
   * New upstream version (4.1.0.0):
diff --git a/x2goserver/bin/x2gosuspend-session b/x2goserver/bin/x2gosuspend-session
index 4d6c0fc..3252ea5 100755
--- a/x2goserver/bin/x2gosuspend-session
+++ b/x2goserver/bin/x2gosuspend-session
@@ -20,10 +20,21 @@
 # Copyright (C) 2007-2013  Oleksandr Shneyder <oleksandr.shneyder at obviously-nice.de>
 # Copyright (C) 2007-2013  Heinz-Markus Graesing <heinz-m.graesing at obviously-nice.de>
 
-if [ $# -eq 1   ]; then
+usage() {
+	echo "$(basename $0): needs <X2GO-SESSION> as first argument. Alternatively, you can set \$X2GO_SESSION with the correct session name" 1>&2
+        exit -1
+}
+
+if [ $# -eq 1 ]; then
 	SESSION_NAME="$1"
-else 
+elif
 	SESSION_NAME="$X2GO_SESSION"
+else
+	usage
+fi
+
+if [ -z $SESSION_NAME ]; then
+	usage
 fi
 
 X2GO_LIB_PATH="$(x2gopath libexec)";
diff --git a/x2goserver/bin/x2goterminate-session b/x2goserver/bin/x2goterminate-session
index c8b5c92..d4c38a4 100755
--- a/x2goserver/bin/x2goterminate-session
+++ b/x2goserver/bin/x2goterminate-session
@@ -20,10 +20,21 @@
 # Copyright (C) 2007-2013  Oleksandr Shneyder <oleksandr.shneyder at obviously-nice.de>
 # Copyright (C) 2007-2013  Heinz-Markus Graesing <heinz-m.graesing at obviously-nice.de>
 
-if [ $# -eq 1   ]; then
-	SESSION_NAME="$1"
-else 
-	SESSION_NAME="$X2GO_SESSION"
+usage() {
+        echo "$(basename $0): needs <X2GO-SESSION> as first argument. Alternatively, you can set \$X2GO_SESSION with the correct session name" 1>&2
+        exit -1
+}
+
+if [ $# -eq 1 ]; then
+        SESSION_NAME="$1"
+elif
+        SESSION_NAME="$X2GO_SESSION"
+else
+        usage
+fi
+
+if [ -z $SESSION_NAME ]; then
+        usage
 fi
 
 X2GO_LIB_PATH="$(x2gopath libexec)";


hooks/post-receive
-- 
x2goserver.git (X2Go Server)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "x2goserver.git" (X2Go Server).




More information about the x2go-commits mailing list