This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch master in repository x2gothinclient. from 966d6c5 management/etc/x2gothinclient_settings: add "extras" component. new 3415faf usbmount/x2gousbmount: pull (most) changes from doc:howto:tce wiki page. new c6106bd usbmount/x2gousbmount: whitespace- and comment-only changes. The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Summary of changes: debian/changelog | 7 +++ usbmount/x2gousbmount | 137 +++++++++++++++++++++++++++++++++----------------- 2 files changed, 98 insertions(+), 46 deletions(-) -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2gothinclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository x2gothinclient. commit 3415fafa35ec8c0215c4e61b8330d679d3cf25d1 Author: Stefan Baur <X2Go-ML-1@baur-itcs.de> Date: Thu Jan 17 05:47:11 2019 +0100 usbmount/x2gousbmount: pull (most) changes from doc:howto:tce wiki page. --- debian/changelog | 5 ++++ usbmount/x2gousbmount | 72 +++++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 63 insertions(+), 14 deletions(-) diff --git a/debian/changelog b/debian/changelog index f083c8b..888b59a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,11 @@ x2gothinclient (1.5.0.1-0x2go1) UNRELEASED; urgency=medium - management/etc/x2gothinclient_settings: remove heuler from apt line. - management/etc/x2gothinclient_settings: add "extras" component. + [ Stefan Baur ] + * New upstream release (1.5.0.1): + * usbmount/x2gousbmount: + - Pull (most) changes from doc:howto:tce wiki page. + -- X2Go Release Manager <git-admin@x2go.org> Sun, 02 Dec 2018 06:49:42 +0100 x2gothinclient (1.5.0.0-0x2go1) unstable; urgency=low diff --git a/usbmount/x2gousbmount b/usbmount/x2gousbmount index 946fe72..131a513 100755 --- a/usbmount/x2gousbmount +++ b/usbmount/x2gousbmount @@ -20,7 +20,16 @@ use strict; use File::Path::Expand; +# comment out this "use" and the following two lines, and instead +# uncomment the block below if you need to do early boot stage +# debugging of the automounter, when rsyslogd isn't running yet use Sys::Syslog qw( :standard :macros ); +openlog($0, 'cons,pid', 'user'); +setlogmask(LOG_UPTO(LOG_NOTICE)); +#open (B, ">> /var/log/usbdebug"); +#sub syslog { +# print B $_[0] . ': ' . $_[1] . "\n"; +#} my $user; if ( -f "/etc/x2go/x2gothinclient-minidesktop_start" ) { @@ -70,9 +79,6 @@ unless ( -d expand_filename("~$user/logins")) { chown $uid, $gid, expand_filename("~$user/logins"); } -openlog($0,'cons,pid','user'); -setlogmask( LOG_UPTO(LOG_NOTICE) ); - sub check_x2gothinclientmode { my $ret = 0; @@ -94,8 +100,10 @@ sub check_x2gothinclientmode { return $ret; } -if ( check_x2gothinclientmode() || ( -x "/etc/x2go/x2gothinclient-minidesktop_start" ) ) +# TCE-NFS TCE-Live MMD-Live +if ((check_x2gothinclientmode()) || (-x "/lib/live/config/2900-x2go-thinclientconfig") || (-x "/etc/x2go/x2gothinclient-minidesktop_start")) { + syslog('notice', "some kind of thinclient mode detected"); open (F,">>/var/log/usb"); @@ -127,7 +135,12 @@ if ( check_x2gothinclientmode() || ( -x "/etc/x2go/x2gothinclient-minidesktop_st mkdir("/media/$name"); print F "$name\n"; - if ( $action eq "add") + if (`lsblk -ln -oRM $dev` =~ /0$/) { + syslog('notice', "device is non-removable device, skipping"); + exit 0; + } + + if ( $action eq "add" ) { ### @@ -149,16 +162,26 @@ if ( check_x2gothinclientmode() || ( -x "/etc/x2go/x2gothinclient-minidesktop_st # would only cause a mount of the iso9660 raw device, # blocking the mount of individual partitions # real optical media ->x2gocdmanager/x2gothinclient-cdmanager package - if(system("mount -tvfat,ntfs $dev /media/$name/$ldev -o uid=$user,sync,uni_xlate")==0) + + if (system("mount -tntfs $dev /media/$name/$ldev -o uid=$user,sync,uni_xlate") == 0) { - syslog('notice', "USB device $name ($ldev) successfully mounted (probably vfat or ntfs)"); + syslog('notice', "USB device $name ($ldev) successfully mounted (ntfs detected)"); # if mounted, inform x2goclient about it... system("touch $mntdir/$ldev.mounted"); open (D,">",expand_filename("~$user/export/$name.$ldev")); print D "export=/media/$name/$ldev\n"; close (D); } - elsif(system("mount -t hfs $dev /media/$name/$ldev -o uid=$user,sync")==0) + elsif (system("mount -tvfat $dev /media/$name/$ldev -o uid=$user,sync,uni_xlate") == 0) + { + syslog('notice', "USB device $name ($ldev) successfully mounted (vfat detected)"); + # if mounted, inform x2goclient about it... + system("touch $mntdir/$ldev.mounted"); + open (D, ">", expand_filename("~$user/export/$name.$ldev")); + print D "export=/media/$name/$ldev\n"; + close (D); + } + elsif (system("mount -t hfs $dev /media/$name/$ldev -o uid=$user,sync") == 0) { syslog('notice', "USB device $name ($ldev) successfully mounted (hfs detected)"); # if mounted, inform x2goclient about it... @@ -176,10 +199,7 @@ if ( check_x2gothinclientmode() || ( -x "/etc/x2go/x2gothinclient-minidesktop_st print D "export=/media/$name/$ldev\n"; close (D); } - # We use fuseext2 for read-only EXT* mounts since this driver does not - # check the usual file permission hierarchy and allows (read-only) - # access to any file on the file system. - elsif(system("fuseext2 $dev /media/$name/$ldev -o ro")==0) + elsif (system("fuseext2 $dev /media/$name/$ldev -o ro,allow_other") == 0) { syslog('notice', "USB device $name ($ldev) successfully mounted readonly (ext*fs detected)"); # if mounted, inform x2goclient about it... @@ -206,11 +226,13 @@ if ( check_x2gothinclientmode() || ( -x "/etc/x2go/x2gothinclient-minidesktop_st open (D,">",expand_filename("~$user/logins/$name.$ldev")); print D "login=/media/$name/$ldev\n"; close (D); + print F "encrypted mount successful ($ldev)\n"; } else { # on mount failures release the decrypted device again system("/sbin/cryptsetup luksClose keystick"); + print F "mount failed ($ldev)\n"; } } else @@ -218,6 +240,21 @@ if ( check_x2gothinclientmode() || ( -x "/etc/x2go/x2gothinclient-minidesktop_st print F "cryptodisk already present\n"; } } + if (-e "/media/$name/$ldev") { + print F "detected mountpoint '/media/$name/$ldev'\n"; + print F "running '/sbin/blkid -o value -s LABEL $dev'\n"; + my $label = `/sbin/blkid -o value -s LABEL $dev`; + chomp($label); + if ($label) { + print F "symlinking '/media/$name/$ldev' and '/media/$name/$label'\n"; + unlink "/media/$name/$label" if ( -l "/media/$name/$label" ); + symlink("/media/$name/$ldev", "/media/$name/$label"); + open (D, ">>", expand_filename("~$user/export/$name.$ldev")); + print D "export=/media/$name/$label\n"; + close (D); + } + } + } elsif ( $action eq "remove" ) { @@ -234,8 +271,13 @@ if ( check_x2gothinclientmode() || ( -x "/etc/x2go/x2gothinclient-minidesktop_st # inform x2goclient that the device has been removed system ("umount -ff /media/$name/$ldev"); unlink ("$mntdir/$ldev.mounted"); - open ( D,">",expand_filename("~$user/export/$name.$ldev.unexport")); - print D "unexport=/media/$name/$ldev\n"; + open (D, ">", expand_filename("~$user/export/$name.$ldev.unexport")); + open (I, "<", expand_filename("~$user/export/$name.$ldev")); + while (<I>) { + $_ =~ s/^export=/unexport=/i; + print D $_; + } + close (I); close (D); syslog('notice', "USB device $name ($ldev) successfully unmounted"); } @@ -253,4 +295,6 @@ if ( check_x2gothinclientmode() || ( -x "/etc/x2go/x2gothinclient-minidesktop_st } close (F); +} else { + syslog('notice', "not in any thinclient mode, exiting"); } -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2gothinclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository x2gothinclient. commit c6106bd12ca0278b8706e87813ff782c0bbb6132 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Jan 17 05:49:40 2019 +0100 usbmount/x2gousbmount: whitespace- and comment-only changes. --- debian/changelog | 2 ++ usbmount/x2gousbmount | 65 ++++++++++++++++++++++++++------------------------- 2 files changed, 35 insertions(+), 32 deletions(-) diff --git a/debian/changelog b/debian/changelog index 888b59a..4e5d77b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,8 @@ x2gothinclient (1.5.0.1-0x2go1) UNRELEASED; urgency=medium * New upstream release (1.5.0.1): - management/etc/x2gothinclient_settings: remove heuler from apt line. - management/etc/x2gothinclient_settings: add "extras" component. + * usbmount/x2gousbmount: + - Whitespace- and comment-only changes. [ Stefan Baur ] * New upstream release (1.5.0.1): diff --git a/usbmount/x2gousbmount b/usbmount/x2gousbmount index 131a513..3ecce00 100755 --- a/usbmount/x2gousbmount +++ b/usbmount/x2gousbmount @@ -1,6 +1,6 @@ #!/usr/bin/perl -# Copyright (C) 2007-2018 by X2Go project, https://wiki.x2go.org +# Copyright (C) 2007-2019 by X2Go Project, https://wiki.x2go.org # Oleksandr Shneyder <o.shneyder@phoca-gmbh.de> # X2Go is free software; you can redistribute it and/or modify @@ -36,19 +36,19 @@ if ( -f "/etc/x2go/x2gothinclient-minidesktop_start" ) { # this is a minidesktop environment, which uses # username "x2gothinclient" regardless of whether # it runs on X2Go-TCE-Live or X2Go-TCE-NFS - $user='x2gothinclient'; + $user = 'x2gothinclient'; } elsif ( -d "/lib/live/config" ) { # this is X2Go-TCE-Live, but not with a minidesktop # (if it were, the first condition would have matched), # so we use Debian-Live's standard username "user" - $user='user'; + $user = 'user'; } else { # this is X2Go-TCE-NFS or something completely different, # so we'll play it safe and pick the username "x2gothinclient" # just like previous versions of this script did - $user='x2gothinclient'; + $user = 'x2gothinclient'; } # We need this as chown requires numeric uid/gid @@ -83,20 +83,21 @@ sub check_x2gothinclientmode { my $ret = 0; # Check for x2gothinclientd first... - my $x=`ps ax | grep x2gothinclient`; - if ( $x=~m/thinclientd/ ) + my $x = `ps ax | grep x2gothinclient`; + if ($x =~ m/thinclientd/) { $ret = 1; } # And for x2goclient --thinclient if nothing was found. if (!$ret) { - $x=`ps u -C x2goclient`; - if ( $x=~m/\W*--thinclient\W*/ ) + $x = `ps u -C x2goclient`; + if ($x =~ m/\W*--thinclient\W*/) { $ret = 1; } } + return $ret; } @@ -105,31 +106,31 @@ if ((check_x2gothinclientmode()) || (-x "/lib/live/config/2900-x2go-thinclientco { syslog('notice', "some kind of thinclient mode detected"); - open (F,">>/var/log/usb"); + open (F, ">> /var/log/usb"); - my $dev=$ENV{'DEVNAME'}; - my $model=$ENV{'ID_MODEL'}; - my $vendor=$ENV{'ID_VENDOR'}; - my $action=$ENV{'ACTION'}; - my @ldev=split("/","$dev"); - my $ldev=@ldev[@ldev-1]; + my $dev = $ENV{'DEVNAME'}; + my $model = $ENV{'ID_MODEL'}; + my $vendor = $ENV{'ID_VENDOR'}; + my $action = $ENV{'ACTION'}; + my @ldev = split("/","$dev"); + my $ldev = @ldev[@ldev-1]; # mntdir is not the directory where the mountpoint will be rooted, # but where tracking of mount states takes place my $mntdir; if ( -d expand_filename("~$user/mounts")) { - $mntdir=expand_filename("~$user/mounts"); + $mntdir = expand_filename("~$user/mounts"); } elsif ( -d "/var/run" ) { - $mntdir="/var/run"; + $mntdir = "/var/run"; } elsif ( -d "/run" ) { - $mntdir="/run"; + $mntdir = "/run"; } else { die "No directory found that we could use as \$mntdir..." } - my $name="${vendor}_${model}"; - $name=~s/ //g; - $name=~s/\\//g; - $name=~s/\///g; + my $name = "${vendor}_${model}"; + $name =~ s/ //g; + $name =~ s/\\//g; + $name =~ s/\///g; print F "action: $action, device: $dev, model: $model ($ldev), total: $name\n"; mkdir("/media"); mkdir("/media/$name"); @@ -168,7 +169,7 @@ if ((check_x2gothinclientmode()) || (-x "/lib/live/config/2900-x2go-thinclientco syslog('notice', "USB device $name ($ldev) successfully mounted (ntfs detected)"); # if mounted, inform x2goclient about it... system("touch $mntdir/$ldev.mounted"); - open (D,">",expand_filename("~$user/export/$name.$ldev")); + open (D, ">", expand_filename("~$user/export/$name.$ldev")); print D "export=/media/$name/$ldev\n"; close (D); } @@ -186,16 +187,16 @@ if ((check_x2gothinclientmode()) || (-x "/lib/live/config/2900-x2go-thinclientco syslog('notice', "USB device $name ($ldev) successfully mounted (hfs detected)"); # if mounted, inform x2goclient about it... system("touch $mntdir/$ldev.mounted"); - open (D,">",expand_filename("~$user/export/$name.$ldev")); + open (D, ">", expand_filename("~$user/export/$name.$ldev")); print D "export=/media/$name/$ldev\n"; close (D); } - elsif(system("mount -t hpfs $dev /media/$name/$ldev -o uid=$user,sync")==0) + elsif (system("mount -t hpfs $dev /media/$name/$ldev -o uid=$user,sync") == 0) { syslog('notice', "USB device $name ($ldev) successfully mounted (hpfs detected)"); # if mounted, inform x2goclient about it... system("touch $mntdir/$ldev.mounted"); - open (D,">",expand_filename("~$user/export/$name.$ldev")); + open (D, ">", expand_filename("~$user/export/$name.$ldev")); print D "export=/media/$name/$ldev\n"; close (D); } @@ -204,7 +205,7 @@ if ((check_x2gothinclientmode()) || (-x "/lib/live/config/2900-x2go-thinclientco syslog('notice', "USB device $name ($ldev) successfully mounted readonly (ext*fs detected)"); # if mounted, inform x2goclient about it... system("touch $mntdir/$ldev.mounted"); - open (D,">",expand_filename("~$user/export/$name.$ldev")); + open (D, ">", expand_filename("~$user/export/$name.$ldev")); print D "export=/media/$name/$ldev\n"; close (D); } @@ -212,18 +213,18 @@ if ((check_x2gothinclientmode()) || (-x "/lib/live/config/2900-x2go-thinclientco { # the mount failed, let's assume that the device is encrypted... my $enc=`ls -1 $mntdir | grep .encrypted`; - if( $enc eq "" ) + if ($enc eq "") { # use cryptsetup to decrypt the device... system("/sbin/cryptsetup --key-file /etc/keys/keystick.key luksOpen $dev keystick"); # mount the ,,decrypted'' USB device via devmapper... - if(system("mount /dev/mapper/keystick /media/$name/$ldev ")==0) + if (system("mount /dev/mapper/keystick /media/$name/$ldev") == 0) { # inform x2goclient about this... system("touch $mntdir/$ldev.encrypted"); system("chown -R $user /media/$name/$ldev/dsa.key"); - open (D,">",expand_filename("~$user/logins/$name.$ldev")); + open (D, ">", expand_filename("~$user/logins/$name.$ldev")); print D "login=/media/$name/$ldev\n"; close (D); print F "encrypted mount successful ($ldev)\n"; @@ -256,7 +257,7 @@ if ((check_x2gothinclientmode()) || (-x "/lib/live/config/2900-x2go-thinclientco } } - elsif ( $action eq "remove" ) + elsif ($action eq "remove") { ### @@ -286,7 +287,7 @@ if ((check_x2gothinclientmode()) || (-x "/lib/live/config/2900-x2go-thinclientco # inform x2goclient that the device has been removed # release the encrypted device mapping unlink ("$mntdir/$ldev.encrypted"); - open ( D,">",expand_filename("~$user/logins/$name.$ldev.unexport")); + open ( D, ">", expand_filename("~$user/logins/$name.$ldev.unexport")); print D "logout=/media/$name/$ldev\n"; system("umount /media/$name/$ldev"); system("/sbin/cryptsetup luksClose keystick"); -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2gothinclient.git