[pkg-remote-commits] [x2goserver] 03/10: debian/patches: Drop 1002_backport-x2golistshadowsessions.patch. Accepted upstream.
Mike Gabriel
sunweaver at debian.org
Mon Dec 11 23:02:36 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 271e2dea6b0e95df564e6f0ac02f297d49bc781b
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date: Mon Dec 11 22:50:41 2017 +0100
debian/patches: Drop 1002_backport-x2golistshadowsessions.patch. Accepted upstream.
---
.../1002_backport-x2golistshadowsessions.patch | 326 ---------------------
1 file changed, 326 deletions(-)
diff --git a/debian/patches/1002_backport-x2golistshadowsessions.patch b/debian/patches/1002_backport-x2golistshadowsessions.patch
deleted file mode 100644
index 0aeb5c4..0000000
--- a/debian/patches/1002_backport-x2golistshadowsessions.patch
+++ /dev/null
@@ -1,326 +0,0 @@
-Origin: http://code.x2go.org/gitweb?p=x2goserver.git;a=history;f=x2goserver/bin/x2golistshadowsessions;h=78e8ae65707edb90be07e761cc5d41639c4feff1;hb=5d9df9b6a3e2dbf6ae2fe70da65f830920d3d792
-Comment:
- Backported to X2Go Server 4.0.1.x by Mike Gabriel <mike.gabriel at das-netzwerkteam.de>.
-
---- /dev/null
-+++ b/x2goserver/bin/x2golistshadowsessions
-@@ -0,0 +1,126 @@
-+#!/usr/bin/perl
-+
-+# Copyright (C) 2007-2015 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-2015 Oleksandr Shneyder <oleksandr.shneyder at obviously-nice.de>
-+# Copyright (C) 2007-2015 Heinz-Markus Graesing <heinz-m.graesing at obviously-nice.de>
-+
-+use strict;
-+use Sys::Hostname;
-+use Sys::Syslog qw( :standard :macros );
-+
-+use lib `x2gopath lib`;
-+use x2godbwrapper;
-+use x2gologlevel;
-+
-+my $x2go_lib_path = `x2gopath libexec`;
-+
-+openlog($0,'cons,pid','user');
-+setlogmask( LOG_UPTO(x2gologlevel()) );
-+
-+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
-+{
-+ my $state=get_agent_state(@_);
-+ if(($state eq 'SUSPENDING')||($state eq 'SUSPENDED'))
-+ {
-+ return 1;
-+ }
-+ 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)
-+{
-+ $serv=hostname;
-+}
-+
-+my @outp;
-+if($serv eq "--all-servers")
-+{
-+ @outp=db_listshadowsessions_all();
-+}
-+else
-+{
-+ @outp=db_listshadowsessions($serv);
-+}
-+
-+for (my $i=0;$i<@outp;$i++)
-+{
-+ @outp[$i] =~ s/ //g;
-+ @outp[$i] =~ s/\*/ /g;
-+ my @sinfo=split('\\|',"@outp[$i]");
-+ if (@sinfo[4]eq 'F')
-+ {
-+ print "@outp[$i]\n";
-+ }
-+ else
-+ {
-+ if (@sinfo[4]eq 'R')
-+ {
-+ my $shadow_user = @sinfo[1];
-+ $shadow_user =~ s/.*XSHAD(.*)XSHADPP.*/$1/;
-+ if(is_suspended(@sinfo[1], $shadow_user))
-+ {
-+ db_changestatus( 'S', @sinfo[1] );
-+ @outp[$i] =~ s/\|R\|/\|S\|/;
-+ system("x2goumount-session","@sinfo[1]");
-+ }
-+ }
-+ print "@outp[$i]\n";
-+ }
-+}
-+
-+# closing syslog
-+closelog;
---- /dev/null
-+++ b/x2goserver/man/man8/x2golistshadowsessions.8
-@@ -0,0 +1,55 @@
-+'\" -*- coding: utf-8 -*-
-+.if \n(.g .ds T< \\FC
-+.if \n(.g .ds T> \\F[\n[.fam]]
-+.de URL
-+\\$2 \(la\\$1\(ra\\$3
-+..
-+.if \n(.g .mso www.tmac
-+.TH x2golistshadowsessions 8 "Jun 2014" "Version 4.1.0.0-preview" "X2Go Server Tool"
-+.SH NAME
-+x2golistshadowsessions \- List Available X2Go Shadow Sessions for User
-+.SH SYNOPSIS
-+'nh
-+.fi
-+.ad l
-+x2golistshadowsessions [\fI<server_hostname>\fR|\fI--all-servers\fR]
-+
-+.SH DESCRIPTION
-+\fBx2golistshadowsessions\fR returns a list of running or suspended X2Go shadow sessions
-+(sessions that provide the X2Go Desktop Sharing feature) for X2Go server \fI<server_hostname>\fR.
-+If no server hostname is given at the command line, the shadow session list query runs for the local system.
-+.PP
-+\fBx2golistshadowsessions\fR is run with normal user privileges and it is used by X2Go clients to render
-+a list of available X2Go shadow sessions.
-+.SH X2GO CLUSTER MODE
-+If \fBx2golistshadowsessions\fR is executed with the \fI--all-servers\fR option then the central database
-+of your X2Go cluster is queried for running/suspended shadow sessions belonging to the user executing this command.
-+These sessions may be active on any of the X2Go servers within your cluster.
-+.SH RETURN VALUES
-+A line-by-line list of available X2Go sessions. Each line consists of several session attribute fields separated by the pipe
-+symbol (,,|'').
-+.PP
-+The meaning of the session attributes of each output line are shown below:
-+
-+ field 01: \fI<agent_pid>\fR
-+ field 02: \fI<session_id>\fR
-+ field 03: \fI<port>\fR
-+ field 04: \fI<host>\fR
-+ field 05: \fI<state>\fR
-+ field 06: \fI<init_time>\fR
-+ field 07: \fI<session_cookie>\fR
-+ field 08: \fI<client_ip>\fR
-+ field 09: \fI<gr_port>\fR
-+ field 10: \fI<snd_port>\fR
-+ field 11: \fI<last_time>\fR
-+ field 12: \fI<user>\fR
-+ field 13: \fI<age_in_secs>\fR
-+ field 14: \fI<sshfs_port>\fR
-+
-+.PP
-+As exitcode \fBx2golistshadowsessions\fR always returns 0.
-+.SH SEE ALSO
-+x2golistsessions(8), x2golistdesktops(8), x2goresume-session(8), x2gosuspend-session(8), x2goterminate-session(8)
-+.SH AUTHOR
-+This manual has been written by Mike Gabriel <mike.gabriel at das-netzwerkteam.de> for the X2Go project
-+(http://www.x2go.org).
---- a/x2goserver/share/x2gofeature.d/x2goserver.features
-+++ b/x2goserver/share/x2gofeature.d/x2goserver.features
-@@ -36,6 +36,7 @@
- "X2GO_PUBLISHED_APPLICATIONS") echo "ok"; exit 0;;
- "X2GO_SERVERSIDE_DESKTOPCOMMANDS") echo "ok"; exit 0;;
- "X2GO_SET_KEYBOARD") echo "ok"; exit 0;;
-+ "X2GO_LIST_SHADOWSESSIONS") echo "ok"; exit 0;;
- "X2GO_MOUNT_UNCPATHS") echo "ok"; exit 0;;
- "X2GO_CLIPBOARD_MODES") echo "ok"; exit 0;;
- *) exit -1;;
---- a/x2goserver/lib/x2godbwrapper.pm
-+++ b/x2goserver/lib/x2godbwrapper.pm
-@@ -88,7 +88,8 @@
- our @EXPORT=('db_listsessions','db_listsessions_all', 'db_getservers', 'db_getagent', 'db_resume', 'db_changestatus', 'db_getstatus',
- 'db_getdisplays', 'db_insertsession', 'db_getports', 'db_insertport', 'db_rmport', 'db_createsession', 'db_insertmount',
- 'db_getmounts', 'db_deletemount', 'db_getdisplay', 'dbsys_getmounts', 'dbsys_listsessionsroot',
-- 'dbsys_listsessionsroot_all', 'dbsys_rmsessionsroot', 'dbsys_deletemounts');
-+ 'dbsys_listsessionsroot_all', 'dbsys_rmsessionsroot', 'dbsys_deletemounts',
-+ 'db_listshadowsessions', 'db_listshadowsessions_all');
-
- sub dbsys_rmsessionsroot
- {
-@@ -674,3 +675,62 @@
- return split("\n",`$x2go_lib_path/x2gosqlitewrapper listsessions_all`);
- }
- }
-+
-+sub db_listshadowsessions
-+{
-+ my $server=shift or die "argument \"server\" missed";
-+ if ($backend eq 'postgres')
-+ {
-+ my @strings;
-+ my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_;
-+ my $sth=$dbh->prepare("select agent_pid, session_id, display, server, status,
-+ to_char(init_time,'YYYY-MM-DD\"T\"HH24:MI:SS'), cookie, client, gr_port,
-+ sound_port, to_char( last_time, 'YYYY-MM-DD\"T\"HH24:MI:SS'), uname,
-+ to_char(now()- init_time,'SSSS'), fs_port from sessions_view
-+ where status !='F' and server='$server' and
-+ (session_id is like '%XSHAD%') order by status desc");
-+ $sth->execute() or die;
-+ my @data;
-+ my $i=0;
-+ while (@data = $sth->fetchrow_array)
-+ {
-+ @strings[$i++]=join('|', at data);
-+ }
-+ $sth->finish();
-+ undef $dbh;
-+ return @strings;
-+ }
-+ if ($backend eq 'sqlite')
-+ {
-+ return split("\n",`$x2go_lib_path/x2gosqlitewrapper listshadowsessions $server`);
-+ }
-+}
-+
-+sub db_listshadowsessions_all
-+{
-+ if($backend eq 'postgres')
-+ {
-+ my @strings;
-+ my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_;
-+ my $sth=$dbh->prepare("select agent_pid, session_id, display, server, status,
-+ to_char(init_time,'YYYY-MM-DD\"T\"HH24:MI:SS'), cookie, client, gr_port,
-+ sound_port, to_char( last_time, 'YYYY-MM-DD\"T\"HH24:MI:SS'), uname,
-+ to_char(now()- init_time,'SSSS'), fs_port from sessions_view
-+ where status !='F' and
-+ (session_id is like '%XSHAD%') order by status desc");
-+ $sth->execute()or die;
-+ my @data;
-+ my $i=0;
-+ while (@data = $sth->fetchrow_array)
-+ {
-+ @strings[$i++]=join('|', at data);
-+ }
-+ $sth->finish();
-+ undef $dbh;
-+ return @strings;
-+ }
-+ if ($backend eq 'sqlite')
-+ {
-+ return split("\n",`$x2go_lib_path/x2gosqlitewrapper listshadowsessions_all`);
-+ }
-+}
---- a/x2goserver/lib/x2gosqlitewrapper.pl
-+++ b/x2goserver/lib/x2gosqlitewrapper.pl
-@@ -509,6 +509,47 @@
- }
- fetchrow_printall_array($sth);
- }
-+
-+elsif($cmd eq "listshadowsessions")
-+{
-+ my $server=shift or die "argument \"server\" missed";
-+ my @strings;
-+ my $sth=$dbh->prepare("select agent_pid, session_id, display, server, status,
-+ strftime('%Y-%m-%dT%H:%M:%S',init_time),
-+ cookie,client,gr_port,sound_port,
-+ strftime('%Y-%m-%dT%H:%M:%S',last_time),
-+ uname,
-+ strftime('%s','now','localtime') - strftime('%s',init_time),fs_port from sessions
-+ where status !='F' and server=? and uname=?
-+ and ( session_id like '%XSHAD%') order by status desc");
-+ $sth->execute($server, $realuser);
-+ if ($sth->err())
-+ {
-+ syslog('error', "listshadowsessions (SQLite3 session db backend) failed with exitcode: $sth->err()");
-+ die();
-+ }
-+ fetchrow_printall_array($sth);
-+}
-+
-+elsif($cmd eq "listshadowsessions_all")
-+{
-+ my @strings;
-+ my $sth=$dbh->prepare("select agent_pid, session_id, display, server, status,
-+ strftime('%Y-%m-%dT%H:%M:%S',init_time),
-+ cookie,client,gr_port,sound_port,
-+ strftime('%Y-%m-%dT%H:%M:%S',last_time),
-+ 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())
-+ {
-+ syslog('error', "listshadowsessions_all (SQLite3 session db backend) failed with exitcode: $sth->err()");
-+ die();
-+ }
-+ fetchrow_printall_array($sth);
-+}
-+
- else
- {
- print "unknown command $cmd\n";
--
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