[X2Go-Commits] x2goserver.git - build-baikal (branch) updated: 3.1.1.1-5-g197c283

X2Go dev team git-admin at x2go.org
Fri Jan 3 20:53:05 CET 2014


The branch, build-baikal has been updated
       via  197c283ddac5dad3d438b28bdb8404aea610d3b8 (commit)
      from  ffd7b50051f441dd63ed724216c67ff657cbf99b (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                  |    4 ++++
 x2goserver/bin/x2gomountdirs      |   12 ++++++------
 x2goserver/bin/x2goumount-session |   24 +++++++++++++++++++++---
 3 files changed, 31 insertions(+), 9 deletions(-)

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 7f14ccc..7a9694b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,10 @@ x2goserver (3.1.1.2-0~x2go1) UNRELEASED; urgency=low
     - Use -fPIE gcc (position independed executable) for building
       x2gosqlitewrapper.c (as suggested by Jan Engelhardt).
     - Clean up session.log tmp directory if empty.
+    - Move all X2Go tmp folders (mount points) to /tmp/.x2go-<user>.
+      Make sure all tmp folders get removed if not used any more. Drop
+      symlink ~/media if no client-side folders are mounted into a
+      session.
 
  -- Mike Gabriel <mike.gabriel at das-netzwerkteam.de>  Tue, 26 Jun 2012 09:32:31 +0200
 
diff --git a/x2goserver/bin/x2gomountdirs b/x2goserver/bin/x2gomountdirs
index 88948e3..d4249ad 100755
--- a/x2goserver/bin/x2gomountdirs
+++ b/x2goserver/bin/x2gomountdirs
@@ -33,7 +33,7 @@ setlogmask( LOG_UPTO(x2gologlevel()) );
 
 syslog('info', "x2gomountdirs has been called with options: @ARGV");
 
-my $tmp_dir = $ENV{'TMP'} || '/tmp';
+my $tmp_dir = '/tmp';
 
 my $type=shift;
 my $session=shift;
@@ -100,12 +100,12 @@ close(F);
 chmod(0600,"$key");
 chmod(0600,"$key.ident");
 
-my $mdir="$tmp_dir/$ENV{'USER'}_media";
+my $mdir="$tmp_dir/.x2go-$ENV{'USER'}/media";
 my $ldir="$ENV{'HOME'}/media";
 my $spooldir_lnk="$ENV{'HOME'}/.x2go/C-$session/spool";
-my $spooldir="$tmp_dir/spool_$ENV{'USER'}";
+my $spooldir="$tmp_dir/.x2go-$ENV{'USER'}/spool";
 my $mimeboxdir_lnk="$ENV{'HOME'}/.x2go/C-$session/mimebox";
-my $mimeboxdir="$tmp_dir/mimebox_$ENV{'USER'}";
+my $mimeboxdir="$tmp_dir/.x2go-$ENV{'USER'}/mimebox";
 
 if (! -e $mdir)
 {
@@ -139,7 +139,7 @@ if (! -e $spooldir)
 }
 chmod(0700,$spooldir);
 
-$spooldir="$spooldir/$session";
+$spooldir="$spooldir/C-$session";
 if (! -e $spooldir)
 {
 	mkdir($spooldir);
@@ -152,7 +152,7 @@ if (! -e $mimeboxdir)
 }
 chmod(0700,$mimeboxdir);
 
-$mimeboxdir="$mimeboxdir/$session";
+$mimeboxdir="$mimeboxdir/C-$session";
 if (! -e $mimeboxdir)
 {
 	mkdir($mimeboxdir);
diff --git a/x2goserver/bin/x2goumount-session b/x2goserver/bin/x2goumount-session
index 6d5f062..01d3857 100755
--- a/x2goserver/bin/x2goumount-session
+++ b/x2goserver/bin/x2goumount-session
@@ -34,13 +34,17 @@ setlogmask( LOG_UPTO(x2gologlevel()) );
 
 syslog('info', "x2goumount-session has been called with options: @ARGV");
 
-my $tmp_dir = $ENV{'TMP'} || '/tmp';
+my $tmp_dir = '/tmp';
 
 my $session=shift;
 my $only_path=shift;
 my $uname=$ENV{'USER'};
 my $serv=hostname;
 
+my $mdir="$tmp_dir/.x2go-$ENV{'USER'}/media";
+my $spooldir="$tmp_dir/.x2go-$ENV{'USER'}/spool";
+my $mimeboxdir="$tmp_dir/.x2go-$ENV{'USER'}/mimebox";
+
 if ($only_path)
 {
 	$only_path=~s/\/ramdrive\/mnt\///;
@@ -57,8 +61,8 @@ if ($only_path)
 
 	### FIXME: handle CDROM and Removable Media mounts here, as well!!!
 
-	$only_path="$tmp_dir/$ENV{'USER'}_media/disk/$only_path";
-	#                                       ^^^^
+	$only_path="$tmp_dir/.x2go-$ENV{'USER'}/media/disk/$only_path";
+	#                                             ^^^^
 	syslog('debug',"x2goumount-session unmounting $only_path only");
 }
 
@@ -193,6 +197,20 @@ break:
 cont:
 }
 
+# try to eliminate parent directory of mountpoints
+rmdir ("$mdir/disk");
+rmdir ("$mdir/cd");
+rmdir ("$mdir/rm");
+rmdir ("$mdir");
+if (( ! -d "$mdir" ) && ( -l "$ENV{'HOME'}/media" ))
+{
+	system("rm -f $ENV{'HOME'}/media");
+}
+rmdir ("$spooldir/C-$session");
+rmdir ("$spooldir");
+rmdir ("$mimeboxdir/C-$session");
+rmdir ("$mimeboxdir");
+
 # closing syslog 
 closelog;
 


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