[X2Go-Commits] [x2gobroker] 01/01: When the x2gobroker-agent command call is shipped via $SSH_ORIGINAL_COMMAND environment var, make sure to strip-off "sh -c" from the command's beginning.

git-admin at x2go.org git-admin at x2go.org
Fri Apr 3 17:44:37 CEST 2015


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

x2go pushed a commit to branch master
in repository x2gobroker.

commit 02a049abc14ae8a3b1643a2714b49f42e269c244
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Fri Apr 3 17:44:22 2015 +0200

    When the x2gobroker-agent command call is shipped via $SSH_ORIGINAL_COMMAND environment var, make sure to strip-off "sh -c" from the command's beginning.
---
 debian/changelog        |    3 +++
 lib/x2gobroker-agent.pl |    4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index fed1748..5fdac86 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -315,6 +315,9 @@ x2gobroker (0.0.3.0-0x2go1) UNRELEASED; urgency=low
     - x2gobroker-ssh: When agent query mode is set to LOCAL, Execute
       x2gobroker-agent via sudo as group "X2GOBROKER_DAEMON_GROUP". (Fixes:
       #835).
+    - When the x2gobroker-agent command call is shipped via
+      $SSH_ORIGINAL_COMMAND environment var, make sure to strip-off
+      "sh -c" from the command's beginning.
   * debian/control:
     + Provide separate bin:package for SSH brokerage: x2gobroker-ssh.
     + Replace LDAP support with session brokerage support in LONG_DESCRIPTION.
diff --git a/lib/x2gobroker-agent.pl b/lib/x2gobroker-agent.pl
index 249a62d..d8a1b5e 100755
--- a/lib/x2gobroker-agent.pl
+++ b/lib/x2gobroker-agent.pl
@@ -27,7 +27,9 @@ use POSIX;
 
 # are we running via SSH's ForceCommand?
 if ($ENV{"SSH_ORIGINAL_COMMAND"} =~ m/\/usr\/.*\/x2go\/x2gobroker-agent\ .*/ ) {
-        @ARGV = split / /, $ENV{'SSH_ORIGINAL_COMMAND'};
+	my $ssh_original_command = $ENV{'SSH_ORIGINAL_COMMAND'};
+	$ssh_original_command =~ s/.*(\/usr\/.*\/x2go\/x2gobroker-agent.*)/\1/;
+	@ARGV = split / /, $ssh_original_command;
 	@ARGV = @ARGV[1..$#ARGV];
 }
 

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


More information about the x2go-commits mailing list