[pkg-remote-commits] [x2goserver] 01/02: debian/patches: Update 1002_backport-x2golistshadowsessions.patch. Sync with the upstream backport. Add missing function get_agent_state().
Mike Gabriel
sunweaver at debian.org
Thu Oct 26 08:02:48 UTC 2017
This is an automated email from the git hooks/post-receive script.
sunweaver pushed a commit to branch master
in repository x2goserver.
commit b6e3f91bd6d53dfbc7296be807bf298d8e4dfa00
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date: Thu Oct 26 09:57:43 2017 +0200
debian/patches: Update 1002_backport-x2golistshadowsessions.patch. Sync with the upstream backport. Add missing function get_agent_state().
---
.../1002_backport-x2golistshadowsessions.patch | 53 ++++++++++++++++------
1 file changed, 40 insertions(+), 13 deletions(-)
diff --git a/debian/patches/1002_backport-x2golistshadowsessions.patch b/debian/patches/1002_backport-x2golistshadowsessions.patch
index ffdefa3..0aeb5c4 100644
--- a/debian/patches/1002_backport-x2golistshadowsessions.patch
+++ b/debian/patches/1002_backport-x2golistshadowsessions.patch
@@ -4,7 +4,7 @@ Comment:
--- /dev/null
+++ b/x2goserver/bin/x2golistshadowsessions
-@@ -0,0 +1,97 @@
+@@ -0,0 +1,126 @@
+#!/usr/bin/perl
+
+# Copyright (C) 2007-2015 X2Go Project - http://wiki.x2go.org
@@ -32,7 +32,7 @@ Comment:
+use Sys::Syslog qw( :standard :macros );
+
+use lib `x2gopath lib`;
-+use x2godbwrapper;
++use x2godbwrapper;
+use x2gologlevel;
+
+my $x2go_lib_path = `x2gopath libexec`;
@@ -40,11 +40,33 @@ Comment:
+openlog($0,'cons,pid','user');
+setlogmask( LOG_UPTO(x2gologlevel()) );
+
-+if ( @ARGV ) {
-+ syslog('info', "x2golistshadowsessions has been called with options: @ARGV");
-+} else {
-+ # hiding normal x2golistshadowsessions calls into debug loglevel
-+ syslog('debug', "x2golistshadowsessions has been called with no option");
++sub get_agent_state
++{
++ my $sess=@_[0];
++ my $user;
++
++ if ( $sess =~ m/.*-[0-9]{2,}-[0-9]{10,}_stS(0|1)XSHAD.*XSHADPP.*/ ) {
++ my $shadow_user = $sess;
++ $shadow_user =~ s/.*XSHAD(.*)XSHADPP.*/$1/;
++ $user = $shadow_user;
++ } else {
++ $user=@_[1];
++ }
++
++ my $state;
++ my $stateFile = "/tmp/.x2go-".$user."/C-".$sess."/state";
++ if (! -e $stateFile )
++ {
++ syslog('warning', "$sess: state file for this session does not exist: $stateFile (this can be ignored during session startups)");
++ $state = "UNKNOWN";
++ }
++ else
++ {
++ open(F,"<$stateFile");
++ $state=<F>;
++ close(F);
++ }
++ return $state;
+}
+
+sub is_suspended
@@ -57,6 +79,13 @@ Comment:
+ return 0;
+}
+
++if ( @ARGV ) {
++ syslog('info', "x2golistshadowsessions has been called with options: @ARGV");
++} else {
++ # hiding normal x2golistshadowsessions calls into debug loglevel
++ syslog('debug', "x2golistshadowsessions has been called with no option");
++}
++
+
+my $serv=shift;
+if( ! $serv)
@@ -84,7 +113,7 @@ Comment:
+ print "@outp[$i]\n";
+ }
+ else
-+ {
++ {
+ if (@sinfo[4]eq 'R')
+ {
+ my $shadow_user = @sinfo[1];
@@ -100,7 +129,7 @@ Comment:
+ }
+}
+
-+# closing syslog
++# closing syslog
+closelog;
--- /dev/null
+++ b/x2goserver/man/man8/x2golistshadowsessions.8
@@ -182,7 +211,7 @@ Comment:
sub dbsys_rmsessionsroot
{
-@@ -674,3 +675,63 @@
+@@ -674,3 +675,62 @@
return split("\n",`$x2go_lib_path/x2gosqlitewrapper listsessions_all`);
}
}
@@ -245,10 +274,9 @@ Comment:
+ return split("\n",`$x2go_lib_path/x2gosqlitewrapper listshadowsessions_all`);
+ }
+}
-+
--- a/x2goserver/lib/x2gosqlitewrapper.pl
+++ b/x2goserver/lib/x2gosqlitewrapper.pl
-@@ -509,6 +509,48 @@
+@@ -509,6 +509,47 @@
}
fetchrow_printall_array($sth);
}
@@ -284,7 +312,6 @@ Comment:
+ uname,
+ strftime('%s','now','localtime') - strftime('%s',init_time),fs_port from sessions
+ where status !='F' and uname=? and ( session_id like '%XSHAD%') order by status desc");
-+
+ $sth->execute($realuser);
+ if ($sth->err())
+ {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-remote/x2goserver.git
More information about the pkg-remote-commits
mailing list