summaryrefslogtreecommitdiff
path: root/veracrypt/debian/patches/1001-port-to-libfuse3.patch
blob: d0b956565968659ce0cb66e7bd4bc3dee6d7f303 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
Description: Port from libfuse2 to libfuse3.
From: Unit 193 <unit193@unit193.net>
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 <errno.h>
@@ -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;
bgstack15