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 c5d5b22f094326124ff6976363a8a6ba09a3bfe2 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Sep 24 09:29:57 2014 +0200 Pick x2gogetagentstate from 4.1.0.0 release series and adapt to usage with X2Go Server 4.0.1.x. (Fixes: #619). --- debian/changelog | 2 ++ x2goserver/lib/x2gogetagentstate | 61 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) diff --git a/debian/changelog b/debian/changelog index 3bf8a12..4f6d016 100644 --- a/debian/changelog +++ b/debian/changelog @@ -91,6 +91,8 @@ x2goserver (4.0.1.16-0x2go1) UNRELEASED; urgency=low - Fix x2gormforward for 4.0.1.x release series (the X2Go::Log Perl module only exists in X2Go Server >= 4.1.0.0, the 4.0.1.x release series has to use x2gologlevel.pm in `x2gopath lib`. (Fixes: #617). + - Pick x2gogetagentstate from 4.1.0.0 release series and adapt to usage + with X2Go Server 4.0.1.x. (Fixes: #619). * 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/lib/x2gogetagentstate b/x2goserver/lib/x2gogetagentstate new file mode 100644 index 0000000..3768b89 --- /dev/null +++ b/x2goserver/lib/x2gogetagentstate @@ -0,0 +1,61 @@ +#!/usr/bin/perl + +# Copyright (C) 2007-2014 X2Go Project - http://wiki.x2go.org +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Copyright (C) 2007-2014 Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de> +# Copyright (C) 2007-2014 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> + +use strict; +use Sys::Syslog qw( :standard :macros ); + +use lib `x2gopath lib`; +use x2gologlevel; + +openlog($0,'cons,pid','user'); +setlogmask( LOG_UPTO(x2gologlevel()) ); + +sub get_agent_state +{ + my $sess=@_[1]; + my $user=@_[2]; + my $state; + my $stateFile; + if ( -d "/tmp-inst/${user}/.x2go-${user}" ) { + $stateFile="/tmp-inst/${user}/.x2go-".$user."/C-".$sess."/state"; + } else { + $stateFile = "/tmp/.x2go-".$user."/C-".$sess."/state"; + } + if (! -e $stateFile ) + { + syslog('warning', "$sess: state file for this session does not exists: $stateFile (this can be ignored during session startups)"); + $state="UNKNOWN"; + } + else + { + open(F,"<$stateFile"); + $state=<F>; + close(F); + } + return $state; +} + +my $sid=shift or die "argument session id missed"; +my $user=getpwuid($<); + +print get_agent_state($sid, $user); + -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goserver.git