[X2Go-Commits] x2gothinclient.git - master (branch) updated: 1.1.0.0-31-g808b5e7

X2Go dev team git-admin at x2go.org
Wed Nov 20 13:04:28 CET 2013


The branch, master has been updated
       via  808b5e7ea4e36b0574344e6c98895204a69725a8 (commit)
      from  937fd25f831c5a0e1a617eab132d8f416d5b36ee (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 808b5e7ea4e36b0574344e6c98895204a69725a8
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Wed Nov 20 13:04:07 2013 +0100

    Monitor mounted USB devices via ~x2gothinclient/mounts (and not via deprecated location /var/run).

-----------------------------------------------------------------------

Summary of changes:
 debian/changelog                                   |    2 ++
 .../share/etc/x2gothinclient_init                  |    1 +
 x2gousbmount/x2gousbmount                          |   24 ++++++++++++++------
 3 files changed, 20 insertions(+), 7 deletions(-)

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 5498d6c..6265232 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -23,6 +23,8 @@ x2gothinclient (1.1.0.1-0~x2go1) UNRELEASED; urgency=low
     - Update initramfs at the very end of the TCE creation.
     - Do not over-mount /run as tmpfs. This is already done by the Debian
       boot process.
+    - Monitor mounted USB devices via ~x2gothinclient/mounts (and not via
+      deprecated location /var/run).
   * debian/control:
     + New bin:package x2gothinclient-chroot.
     + Make sure x2gothinclient-chroot pulls in editing tools like
diff --git a/x2gothinclientmanagement/share/etc/x2gothinclient_init b/x2gothinclientmanagement/share/etc/x2gothinclient_init
index e70cf9e..2aae04d 100755
--- a/x2gothinclientmanagement/share/etc/x2gothinclient_init
+++ b/x2gothinclientmanagement/share/etc/x2gothinclient_init
@@ -26,6 +26,7 @@ test -e /etc/x2go/x2gothinclient_sessions && cp /etc/x2go/x2gothinclient_session
 test -e /etc/x2go/freerdp/known_hosts && mkdir -p ~x2gothinclient/.freerdp && cp /etc/x2go/freerdp/known_hosts ~x2gothinclient/.freerdp/known_hosts
 mkdir -p ~x2gothinclient/.kde
 mkdir -p ~x2gothinclient/.kde/socket-`hostname`
+mkdir -p ~x2gothinclient/mounts
 mkdir -p ~x2gothinclient/export
 mkdir -p  ~x2gothinclient/logins
 mkdir -p ~x2gothinclient/.ssh
diff --git a/x2gousbmount/x2gousbmount b/x2gousbmount/x2gousbmount
index 7bf7b5a..28985ca 100755
--- a/x2gousbmount/x2gousbmount
+++ b/x2gousbmount/x2gousbmount
@@ -41,6 +41,16 @@ if ( check_x2gothinclientd() )
 	my $action=$ENV{'ACTION'};
 	my @ldev=split("/","$dev");
 	my $ldev=@ldev[@ldev-1];
+	my $mntdir;
+	if ( -d expand_user("~/mounts")) {
+		$mntdir=expand_user("~/run");
+	} elsif ( -d "/var/run" ) {
+		$mntdir="/var/run";
+	} elsif ( -d "/run" ) {
+		$mntdir="/run";
+	} else {
+		die "No directory found that we could use as \$mntdir..."
+	}
 
 	my $name="${vendor}_${model}";
 	$name=~s/ //g;
@@ -67,7 +77,7 @@ if ( check_x2gothinclientd() )
 		if(system("mount $dev /media/$name/$ldev -o uid=x2gothinclient,sync,uni_xlate")==0)
 		{
 			# if mounted, inform x2goclient about it...
-			system("touch /var/run/$ldev.mounted");
+			system("touch $mntdir/$ldev.mounted");
 			open (D,">",expand_filename("~x2gothinclient/export/$name.$ldev"));
 			print D "export=/media/$name/$ldev\n";
 			close (D);
@@ -75,7 +85,7 @@ if ( check_x2gothinclientd() )
 		else
 		{
 			# the mount failed, let's assume that the device is encrypted...
-			my $enc=`ls -1 /var/run | grep .encrypted`;
+			my $enc=`ls -1 $mntdir | grep .encrypted`;
 			if(  $enc eq "" )
 			{
 				# use cryptsetup to decrypt the device...
@@ -85,7 +95,7 @@ if ( check_x2gothinclientd() )
 				if(system("mount /dev/mapper/keystick  /media/$name/$ldev ")==0)
 				{
 					# inform x2goclient about this...
-					system("touch /var/run/$ldev.encrypted");
+					system("touch $mntdir/$ldev.encrypted");
 					system("chown -R x2gothinclient /media/$name/$ldev/dsa.key");
 					open (D,">",expand_filename("~/x2gothinclient/logins/$name.$ldev"));
 					print D "login=/media/$name/$ldev\n";
@@ -111,20 +121,20 @@ if ( check_x2gothinclientd() )
 		###
 
 		# we rely on our own mount logistics here...
-		if ( -e "/var/run/$ldev.mounted" )
+		if ( -e "$mntdir/$ldev.mounted" )
 		{
 			# inform x2goclient that the device has been removed
 			system ("umount -ff /media/$name/$ldev");
-			unlink ("/var/run/$ldev.mounted");
+			unlink ("$mntdir/$ldev.mounted");
 			open ( D,">",expand_filename("~x2gothinclient/export/$name.$ldev.unexport"));
 			print D "unexport=/media/$name/$ldev\n";
 			close (D);
 		}
-		elsif ( -e "/var/run/$ldev.encrypted" )
+		elsif ( -e "$mntdir/$ldev.encrypted" )
 		{
 			# inform x2goclient that the device has been removed
 			# release the encrypted device mapping
-			unlink ("/var/run/$ldev.encrypted");
+			unlink ("$mntdir/$ldev.encrypted");
 			open ( D,">",expand_filename("~/x2gothinclient/logins/$name.$ldev.unexport"));
 			print D "logout=/media/$name/$ldev\n";
 			system("umount /media/$name/$ldev");


hooks/post-receive
-- 
x2gothinclient.git (X2Go Thin Client Environment)

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 "x2gothinclient.git" (X2Go Thin Client Environment).




More information about the x2go-commits mailing list