[X2Go-Commits] [x2goserver] 06/08: Abort session startup if env var $USER or $SSH_CLIENT are not set. (Fixes: #558).

git-admin at x2go.org git-admin at x2go.org
Wed Aug 20 10:18:36 CEST 2014


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

x2go pushed a commit to branch master
in repository x2goserver.

commit e66ec57f21ee7b88c19735b3d65d3e66885c15bc
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Wed Aug 20 10:01:55 2014 +0200

    Abort session startup if env var $USER or $SSH_CLIENT are not set. (Fixes: #558).
---
 debian/changelog              |    2 ++
 x2goserver/bin/x2gostartagent |    7 +++++++
 2 files changed, 9 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index e329bf0..59ccd6b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -191,6 +191,8 @@ x2goserver (4.0.1.16-0x2go1) UNRELEASED; urgency=low
     - Silently timeout in x2golistdesktops if calls to x2golistsessions and/or
       xwininfo don't produce output within one second. (Fixes: #543).
     - Allow email addresses as login usernames. (Fixes: #573).
+    - Abort session startup if env var $USER or $SSH_CLIENT are not set.
+      (Fixes: #558).
   * 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/x2gostartagent b/x2goserver/bin/x2gostartagent
index da81ae3..102c7f6 100755
--- a/x2goserver/bin/x2gostartagent
+++ b/x2goserver/bin/x2gostartagent
@@ -27,9 +27,16 @@ $X2GO_LIB_PATH/x2gosyslog "$0" "info" "$(basename $0) called with options: $@"
 X2GO_PORT=49 #First port for X2GO=50
 SSH_PORT=30000 #First ssh port 30001
 
+# some sanity checks before session startup...
 if egrep "^backend[ ]*=[ ]*postgres" /etc/x2go/x2gosql/sql 1>/dev/null 2>/dev/null && [ "x$USER" = "xroot" ]; then
 	echo "The super-user \"root\" is not allowed to launch X2Go sessions."
 	exit -1
+elif [ -z "$USER" ]; then
+	echo "The \$USER environment variable is not set. Aborting session startup."
+	exit -2
+elif [ -z "$SSH_CLIENT" ]; then
+	echo "The \$SSH_CLIENT environment variable is not set. Aborting session startup."
+	exit -3
 fi
 
 X2GO_TELEKINESIS_ENABLED=`echo 'use X2Go::Config qw( get_config ); use X2Go::Utils qw( is_true ); my $Config = get_config(); print is_true($Config->param("telekinesis.enable"));' | perl`

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


More information about the x2go-commits mailing list