summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2019-04-02 20:56:27 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2019-04-02 20:56:27 +0100
commit3d81aa100277c67dcd81f6de0ce9102d1009edd6 (patch)
tree14f70ca62db8d2941b995d9fe11e4c23e2b78e1f
parentFix hostname lookup (diff)
downloadnetfs-3d81aa100277c67dcd81f6de0ce9102d1009edd6.tar.bz2
netfs-3d81aa100277c67dcd81f6de0ce9102d1009edd6.tar.xz
netfs-3d81aa100277c67dcd81f6de0ce9102d1009edd6.zip
Zero out f_fsid of VFSnetfs-1.3.3.2
See following comment in statfs(2) Nobody knows what f_fsid is supposed to contain (but see below). The general idea is that f_fsid contains some random stuff....
-rw-r--r--netfs/ice/typeConverter.cpp4
-rw-r--r--netfs/unittests/testCore.cpp1
2 files changed, 3 insertions, 2 deletions
diff --git a/netfs/ice/typeConverter.cpp b/netfs/ice/typeConverter.cpp
index 7619063..0e3ce7f 100644
--- a/netfs/ice/typeConverter.cpp
+++ b/netfs/ice/typeConverter.cpp
@@ -54,7 +54,7 @@ TypeConverter::convert(const NetFS::VFS & v) const
vfs.f_files = v.files;
vfs.f_ffree = v.freeFiles;
vfs.f_favail = v.availFiles;
- vfs.f_fsid = v.FSID;
+ vfs.f_fsid = 0;
vfs.f_flag = v.flags;
vfs.f_namemax = v.maxNameLen;
return vfs;
@@ -92,7 +92,7 @@ TypeConverter::convert(const struct statvfs & s) const
t.files = s.f_files;
t.freeFiles = s.f_ffree;
t.availFiles = s.f_favail;
- safeAssign(t.FSID, s.f_fsid);
+ t.FSID = 0;
safeAssign(t.flags, s.f_flag);
safeAssign(t.maxNameLen, s.f_namemax);
return t;
diff --git a/netfs/unittests/testCore.cpp b/netfs/unittests/testCore.cpp
index 07b5ce6..9c83d8a 100644
--- a/netfs/unittests/testCore.cpp
+++ b/netfs/unittests/testCore.cpp
@@ -117,6 +117,7 @@ BOOST_AUTO_TEST_CASE ( clientInitialised )
{
struct statvfs s;
BOOST_REQUIRE_EQUAL(0, fuse->statfs("/", &s));
+ BOOST_REQUIRE_EQUAL(s.f_fsid, 0);
BOOST_REQUIRE_EQUAL(-ENOENT, fuse->statfs("/missing", &s));
}