[X2Go-Commits] [x2goserver] 02/02: Use File::Which to detect if sshfs command is available before trying to mount a client-side folder.
git-admin at x2go.org
git-admin at x2go.org
Tue Oct 7 15:58:59 CEST 2014
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch release/4.0.1.x
in repository x2goserver.
commit 34be618ca89409388dc5ef3704adefbcc566a758
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date: Tue Oct 7 15:50:20 2014 +0200
Use File::Which to detect if sshfs command is available before trying to mount a client-side folder.
---
debian/changelog | 8 +++++++-
debian/control | 1 +
x2goserver.spec | 1 +
x2goserver/bin/x2gomountdirs | 12 +++++++++++-
4 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 95002e4..72fd132 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,12 @@
x2goserver (4.0.1.19-0x2go1) UNRELEASED; urgency=medium
- * Continue development...
+ * New upstream version (4.0.1.19):
+ - Use File::Which to detect if sshfs command is available
+ before trying to mount a client-side folder.
+ * debian/control:
+ + Add D (x2goserver): libfile-which-perl.
+ * x2goserver.spec:
+ + Add to R: perl(File::Which).
-- Mike Gabriel <mike.gabriel at das-netzwerkteam.de> Tue, 07 Oct 2014 15:35:38 +0200
diff --git a/debian/control b/debian/control
index 2fee7cb..d64bf89 100644
--- a/debian/control
+++ b/debian/control
@@ -28,6 +28,7 @@ Depends:
libdbd-pg-perl,
libdbd-sqlite3-perl,
libfile-basedir-perl,
+ libfile-which-perl,
libcapture-tiny-perl,
adduser,
xauth,
diff --git a/x2goserver.spec b/x2goserver.spec
index eaacb85..e5bc63a 100644
--- a/x2goserver.spec
+++ b/x2goserver.spec
@@ -48,6 +48,7 @@ Requires: sudo
Requires: x2goagent >= 3.5.0.25
Requires: xorg-x11-fonts-misc
Requires: xorg-x11-xauth
+Requires: perl(File::Which)
Requires(pre): shadow-utils
Requires(post): grep
Requires(post): perl(DBD::SQLite)
diff --git a/x2goserver/bin/x2gomountdirs b/x2goserver/bin/x2gomountdirs
index dc6fc45..8ef6ba0 100755
--- a/x2goserver/bin/x2gomountdirs
+++ b/x2goserver/bin/x2gomountdirs
@@ -23,6 +23,7 @@
use strict;
use Sys::Syslog qw( :standard :macros );
use File::BaseDir qw( xdg_config_home );
+use File::Which;
use lib `x2gopath lib`;
use x2godbwrapper;
@@ -34,6 +35,16 @@ setlogmask( LOG_UPTO(x2gologlevel()) );
syslog('info', "x2gomountdirs has been called with options: @ARGV");
+my $msg;
+if (! which ("sshfs") ) {
+ $msg = "the sshfs command is not installed on this X2Go Server, cannot share client-side folders";
+ syslog('warning', "WARNING: $msg");
+ print "$msg\n";
+ # closing syslog
+ closelog;
+ exit 0;
+}
+
sub source_environment {
my $name = shift;
@@ -62,7 +73,6 @@ my $session=shift;
my $user=shift;
my $key=shift;
my @dl;
-my $msg;
my $i=0;
@dl[$i]=shift;
while(@dl[$i])
--
Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goserver.git
More information about the x2go-commits
mailing list