From d63afe519c790c3202c99eec7f3903806cad2098 Mon Sep 17 00:00:00 2001 From: Martin Pärtel Date: Thu, 13 Apr 2017 17:54:38 +0300 Subject: Document that -o dev is required for device files and test it. Fixes #52. --- src/bindfs.1 | 4 ++++ tests/test_bindfs.rb | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/bindfs.1 b/src/bindfs.1 index 121c8ab..e458ecf 100644 --- a/src/bindfs.1 +++ b/src/bindfs.1 @@ -455,6 +455,10 @@ Older systems may require this deprecated fstab syntax. Setuid and setgid bits have no effect inside the mount. This is a necessary security feature of FUSE. +Access to device files is denied by default by FUSE as a security precaution. +Use \fB\-o dev\fP to enable access (requires mounting as root). This may not +be supported on all operating systems. + MacFuse caches file contents by default. This means that changes in source files are not always immediately visible under the mount point. \fB\-o nolocalcaches\fP can be used to disable the cache. diff --git a/tests/test_bindfs.rb b/tests/test_bindfs.rb index ba30528..d3f54b9 100755 --- a/tests/test_bindfs.rb +++ b/tests/test_bindfs.rb @@ -747,6 +747,17 @@ testenv("", :title => "mntdir with newline", :mntdir_name => "a\nb") do assert { File.exist?("a\nb/f") } end +if `uname`.strip != 'FreeBSD' # -o dev is not supported on FreeBSD + root_testenv("-odev") do + system("mknod mnt/zero c 1 5") + data = File.read("mnt/zero", 3) + assert { data.length == 3 } + assert { data.chars.to_a[0] == "\0" } + assert { data.chars.to_a[1] == "\0" } + assert { data.chars.to_a[2] == "\0" } + end +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) -- cgit v1.2.3