The branch, master 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 ----------------------------------------------------------------- commit 2e471b45ddf6a9cd7dca06d3b0f276ef35a3788a Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jun 21 12:04:27 2012 +0200 For finished sessions purge all mount points that still hover in the DB's mounts table. ----------------------------------------------------------------------- Summary of changes: debian/changelog | 2 ++ x2goserver/lib/x2godbwrapper.pm | 21 ++++++++++++++++++++- x2goserver/lib/x2gosqlitewrapper.pl | 14 ++++++++++++++ 3 files changed, 36 insertions(+), 1 deletions(-) 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).