[X2Go-Commits] x2goserver.git - build-main (branch) updated: 3.1.1.0-26-g2e471b4
X2Go dev team
git-admin at x2go.org
Wed Dec 4 06:18:19 CET 2013
The branch, build-main has been updated
via 2e471b45ddf6a9cd7dca06d3b0f276ef35a3788a (commit)
from 266caa371a9fa8b393a0cf3ae7c5126531f95cc0 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
-----------------------------------------------------------------------
Summary of changes:
debian/changelog | 2 ++
x2goserver/lib/x2godbwrapper.pm | 21 ++++++++++++++++++++-
x2goserver/lib/x2gosqlitewrapper.pl | 14 ++++++++++++++
3 files changed, 36 insertions(+), 1 deletion(-)
The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 537e086..54de803 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -24,6 +24,8 @@ x2goserver (3.1.1.1-0~x2go1) UNRELEASED; urgency=low
resume if usekbd is set to True and the keyboard type is set ,,auto''.
- Reset keyboard settings to pc104/us before setting client-side keyboard
parameters.
+ - For finished sessions purge all mount points that still hover in the
+ DB's mounts table.
* Depend on x2goagent (>= 2:3.5.0.12), make sure that x2goagent has the patch
105_nxagent_export-remote-keyboard-config.full.patch included.
diff --git a/x2goserver/lib/x2godbwrapper.pm b/x2goserver/lib/x2godbwrapper.pm
index 2690544..f290b71 100644
--- a/x2goserver/lib/x2godbwrapper.pm
+++ b/x2goserver/lib/x2godbwrapper.pm
@@ -88,11 +88,12 @@ use base 'Exporter';
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_listsessionsroot_all', 'dbsys_rmsessionsroot', 'dbsys_deletemounts');
sub dbsys_rmsessionsroot
{
my $sid=shift or die "argument \"session_id\" missed";
+ dbsys_deletemounts($sid);
if($backend eq 'postgres')
{
my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode",
@@ -109,6 +110,24 @@ sub dbsys_rmsessionsroot
}
}
+sub dbsys_deletemounts
+{
+ my $sid=shift or die "argument \"session_id\" missed";
+ if ($backend eq 'postgres')
+ {
+ my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_;
+ my $sth=$dbh->prepare("delete from mounts where session_id='$sid'");
+ $sth->execute();
+ $sth->finish();
+ $dbh->disconnect();
+ }
+ if ($backend eq 'sqlite')
+ {
+ `$x2go_lib_path/x2gosqlitewrapper deletemounts $sid`;
+ }
+ syslog('debug', "dbsys_deletemounts called, session ID: $sid");
+}
+
sub dbsys_listsessionsroot
{
my $server=shift or die "argument \"server\" missed";
diff --git a/x2goserver/lib/x2gosqlitewrapper.pl b/x2goserver/lib/x2gosqlitewrapper.pl
index ba2c02d..f47fdec 100755
--- a/x2goserver/lib/x2gosqlitewrapper.pl
+++ b/x2goserver/lib/x2gosqlitewrapper.pl
@@ -153,6 +153,20 @@ elsif($cmd eq "deletemount")
$sth->finish();
}
+elsif($cmd eq "deletemounts")
+{
+ my $sid=shift or die "argument \"session_id\" missed";
+ check_user($sid);
+ my $sth=$dbh->prepare("delete from mounts where session_id=?");
+ $sth->execute($sid);
+ if ($sth->err())
+ {
+ syslog('error', "deletemounts (SQLite3 session db backend) failed with exitcode: $sth->err()");
+ die();
+ }
+ $sth->finish();
+}
+
elsif($cmd eq "insertmount")
{
my $sid=shift or die "argument \"session_id\" missed";
hooks/post-receive
--
x2goserver.git (X2Go Server)
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "x2goserver.git" (X2Go Server).
More information about the x2go-commits
mailing list