aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac16
-rw-r--r--src/Makefile.am4
-rwxr-xr-xtests/test_bindfs.rb19
3 files changed, 35 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index 7764e5b..6c08bb2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -88,11 +88,25 @@ AC_DEFUN([CHECK_FUSE3],
)]
)
+AC_DEFUN([CHECK_FUSE_T],
+ [PKG_CHECK_MODULES([fuse_t], [fuse-t >= 1.0.0],
+ [
+ AC_DEFINE([HAVE_FUSE_T], [1], [Have FUSE >= 1.0.0])
+ AC_DEFINE([FUSE_USE_VERSION], [34], [FUSE API VERSION = 3.4])
+ ],
+ [$1]
+ )]
+)
+
+
AS_IF([test "x$with_fuse2" == "xyes"],
[CHECK_FUSE2([AC_MSG_ERROR([FUSE 2 not found])])],
[AS_IF([test "x$with_fuse3" == "xyes"],
[CHECK_FUSE3([AC_MSG_ERROR([FUSE 3 not found])])],
- [CHECK_FUSE3([CHECK_FUSE2([AC_MSG_ERROR([FUSE not found])])])]
+ [AS_IF([test "x$with_fuse_t" == "xyes"],
+ [CHECK_FUSE_T([AC_MSG_ERROR([FUSE-T not found])])],
+ [CHECK_FUSE3([CHECK_FUSE2([CHECK_FUSE_T([AC_MSG_ERROR([FUSE not found])])])])]
+ )]
)]
)
diff --git a/src/Makefile.am b/src/Makefile.am
index 7e25193..383f791 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -5,8 +5,8 @@ bin_PROGRAMS = bindfs
noinst_HEADERS = debug.h permchain.h userinfo.h arena.h misc.h usermap.h rate_limiter.h
bindfs_SOURCES = bindfs.c debug.c permchain.c userinfo.c arena.c misc.c usermap.c rate_limiter.c
-AM_CPPFLAGS = ${my_CPPFLAGS} ${fuse_CFLAGS} ${fuse3_CFLAGS}
+AM_CPPFLAGS = ${my_CPPFLAGS} ${fuse_CFLAGS} ${fuse3_CFLAGS} ${fuse_t_CFLAGS}
AM_CFLAGS = ${my_CFLAGS}
-bindfs_LDADD = $(fuse_LIBS) ${fuse3_LIBS} ${my_LDFLAGS}
+bindfs_LDADD = ${fuse_LIBS} ${fuse3_LIBS} ${fuse_t_LIBS} ${my_LDFLAGS}
man_MANS = bindfs.1
diff --git a/tests/test_bindfs.rb b/tests/test_bindfs.rb
index 3243b7f..fe20055 100755
--- a/tests/test_bindfs.rb
+++ b/tests/test_bindfs.rb
@@ -31,7 +31,10 @@ include Errno
$have_fuse_3 = Proc.new do
system("pkg-config --exists fuse3")
- $?.success?
+ $?.success? || Proc.new do
+ system("pkg-config --exists fuse-t")
+ $?.success?
+ end.call
end.call
$have_fuse_3_readdir_bug = $have_fuse_3 && Proc.new do
system("pkg-config --max-version=3.10.1 fuse3")
@@ -922,6 +925,20 @@ testenv("-ouser -onofail,nouser,,,delete-deny -o users -o auto,rename-deny,noaut
assert_exception(EPERM) { chmod(0777, 'mnt/file') }
end
+# Issue #132 / PR #133
+if `which nc 2> /dev/null`.strip != ''
+ testenv("", :title => "socket files") do
+ IO.popen("nc -U mnt/sock -l", "r") do |pipe|
+ sleep 0.1 until File.exists?('mnt/sock')
+ system("echo hello | nc -U -q 0 mnt/sock")
+ result = pipe.read
+ assert { result.strip == "hello" }
+ end
+ end
+else
+ puts "Skipping socket file test because 'nc' is not installed."
+end
+
# FIXME: this stuff around testenv is a hax, and testenv may also exit(), which defeats the 'ensure' below.
# the test setup ought to be refactored. It might well use MiniTest or something.
# TODO: support FreeBSD in this test (different group management commands)