Description: Port from libfuse2 to libfuse3. From: Unit 193 Forwarded: https://github.com/veracrypt/VeraCrypt/issues/528 --- src/Driver/Fuse/FuseService.cpp | 26 +++++++++----------------- src/Makefile | 2 +- 2 files changed, 10 insertions(+), 18 deletions(-) --- a/src/Makefile +++ b/src/Makefile @@ -52,7 +52,7 @@ export LFLAGS := export PKG_CONFIG ?= pkg-config export PKG_CONFIG_PATH ?= /usr/local/lib/pkgconfig -export VC_FUSE_PACKAGE := fuse +export VC_FUSE_PACKAGE := fuse3 export VC_OSX_FUSET ?= 0 export WX_CONFIG ?= wx-config --- a/src/Driver/Fuse/FuseService.cpp +++ b/src/Driver/Fuse/FuseService.cpp @@ -13,7 +13,7 @@ #ifdef TC_OPENBSD #define FUSE_USE_VERSION 26 #else -#define FUSE_USE_VERSION 25 +#define FUSE_USE_VERSION 30 #endif #include @@ -56,11 +56,7 @@ namespace VeraCrypt return 0; } -#ifdef TC_OPENBSD - static void *fuse_service_init (struct fuse_conn_info *) -#else - static void *fuse_service_init () -#endif + static void *fuse_service_init (struct fuse_conn_info *, struct fuse_config *config) { try { @@ -104,7 +100,7 @@ namespace VeraCrypt } } - static int fuse_service_getattr (const char *path, struct stat *statData) + static int fuse_service_getattr (const char *path, struct stat *statData, struct fuse_file_info *fi) { try { @@ -261,7 +257,7 @@ namespace VeraCrypt return -ENOENT; } - static int fuse_service_readdir (const char *path, void *buf, fuse_fill_dir_t filler, off_t offset, struct fuse_file_info *fi) + static int fuse_service_readdir (const char *path, void *buf, fuse_fill_dir_t filler, off_t offset, struct fuse_file_info *fi, enum fuse_readdir_flags fl) { try { @@ -271,10 +267,10 @@ namespace VeraCrypt if (strcmp (path, "/") != 0) return -ENOENT; - filler (buf, ".", NULL, 0); - filler (buf, "..", NULL, 0); - filler (buf, FuseService::GetVolumeImagePath() + 1, NULL, 0); - filler (buf, FuseService::GetControlPath() + 1, NULL, 0); + filler (buf, ".", NULL, 0, (enum fuse_fill_dir_flags)0); + filler (buf, "..", NULL, 0, (enum fuse_fill_dir_flags)0); + filler (buf, FuseService::GetVolumeImagePath() + 1, NULL, 0, (enum fuse_fill_dir_flags)0); + filler (buf, FuseService::GetControlPath() + 1, NULL, 0, (enum fuse_fill_dir_flags)0); } catch (...) { @@ -450,7 +446,7 @@ namespace VeraCrypt } ExecFunctor execFunctor (openVolume, slotNumber); - Process::Execute ("fuse", args, -1, &execFunctor); + Process::Execute ("fusermount3", args, -1, &execFunctor); for (int t = 0; true; t++) { @@ -592,11 +588,7 @@ namespace VeraCrypt SignalHandlerPipe->GetWriteFD(); -#ifdef TC_OPENBSD _exit (fuse_main (argc, argv, &fuse_service_oper, NULL)); -#else - _exit (fuse_main (argc, argv, &fuse_service_oper)); -#endif } VolumeInfo FuseService::OpenVolumeInfo;