Compare commits
10 Commits
279744a252
...
f87f5db493
Author | SHA1 | Date |
---|---|---|
![]() |
f87f5db493 | |
![]() |
669a7b4c93 | |
![]() |
84c0898ad2 | |
![]() |
0f0dea9d98 | |
![]() |
c23bd0f99a | |
![]() |
9ce98a3a11 | |
![]() |
ce7e5a65ca | |
![]() |
3b8d476513 | |
![]() |
a6ead49d39 | |
![]() |
0451fe87af |
10
Changelog.md
10
Changelog.md
|
@ -3,7 +3,15 @@
|
|||
|
||||
**v1.6.0**
|
||||
|
||||
- Add `FileSystemHost.SetCapDeleteAccess` [Windows only]. A file system can use this capability to deny delete access on Windows. Such a file system must:
|
||||
- Rename import path to `github.com/winfsp/cgofuse`.
|
||||
|
||||
- Convert package to module.
|
||||
|
||||
- Preliminary support for Windows on ARM64.
|
||||
|
||||
- Add `FileSystemGetpath` interface. A case-insensitive file system can use `Getpath` to report the correct case of a file path on Windows.
|
||||
|
||||
- Add `FileSystemHost.SetCapDeleteAccess`. A file system can use this capability to deny delete access on Windows. Such a file system must:
|
||||
- Implement the `Access` file system operation and handle the new `fuse.DELETE_OK` mask to return `-fuse.EPERM` for files that should not be deleted. An example implementation might look like:
|
||||
```Go
|
||||
func (fs *filesystem) Access(path string, mask uint32) int {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
//go:build windows
|
||||
// +build windows
|
||||
|
||||
/*
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
//go:build cgo
|
||||
// +build cgo
|
||||
|
||||
/*
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
//go:build !cgo && windows
|
||||
// +build !cgo,windows
|
||||
|
||||
/*
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
//go:build cgo
|
||||
// +build cgo
|
||||
|
||||
/*
|
||||
|
@ -15,7 +16,7 @@
|
|||
package fuse
|
||||
|
||||
/*
|
||||
#cgo darwin CFLAGS: -DFUSE_USE_VERSION=28 -D_FILE_OFFSET_BITS=64 -I/usr/local/include/osxfuse/fuse
|
||||
#cgo darwin CFLAGS: -DFUSE_USE_VERSION=28 -D_FILE_OFFSET_BITS=64 -I/usr/local/include/osxfuse/fuse -I/usr/local/include/fuse
|
||||
#cgo freebsd CFLAGS: -DFUSE_USE_VERSION=28 -D_FILE_OFFSET_BITS=64 -I/usr/local/include/fuse
|
||||
#cgo netbsd CFLAGS: -DFUSE_USE_VERSION=28 -D_FILE_OFFSET_BITS=64 -D_KERNTYPES
|
||||
#cgo openbsd CFLAGS: -DFUSE_USE_VERSION=28 -D_FILE_OFFSET_BITS=64
|
||||
|
@ -171,6 +172,8 @@ static void *cgofuse_init_fuse(void)
|
|||
h = dlopen("/usr/local/lib/libfuse.2.dylib", RTLD_NOW); // MacFUSE/OSXFuse >= v4
|
||||
if (0 == h)
|
||||
h = dlopen("/usr/local/lib/libosxfuse.2.dylib", RTLD_NOW); // MacFUSE/OSXFuse < v4
|
||||
if (0 == h)
|
||||
h = dlopen("/usr/local/lib/libfuse-t.dylib", RTLD_NOW); // FUSE-T
|
||||
#elif defined(__FreeBSD__)
|
||||
h = dlopen("libfuse.so.2", RTLD_NOW);
|
||||
#elif defined(__NetBSD__)
|
||||
|
@ -215,7 +218,9 @@ static int (* pfn_fsp_fuse_notify)(struct fsp_fuse_env *env,
|
|||
|
||||
static NTSTATUS FspLoad(void **PModule)
|
||||
{
|
||||
#if defined(_WIN64)
|
||||
#if defined(__aarch64__)
|
||||
#define FSP_DLLNAME "winfsp-a64.dll"
|
||||
#elif defined(__amd64__)
|
||||
#define FSP_DLLNAME "winfsp-x64.dll"
|
||||
#else
|
||||
#define FSP_DLLNAME "winfsp-x86.dll"
|
||||
|
@ -629,9 +634,21 @@ static int hostUnmount(struct fuse *fuse, char *mountpoint)
|
|||
if (0 == umount2(mountpoint, MNT_DETACH))
|
||||
return 1;
|
||||
// linux: umount2 failed; try fusermount
|
||||
char *argv[] =
|
||||
char *paths[] =
|
||||
{
|
||||
"/bin/fusermount",
|
||||
"/usr/bin/fusermount",
|
||||
};
|
||||
char *path = paths[0];
|
||||
for (size_t i = 0; sizeof paths / sizeof paths[0] > i; i++)
|
||||
if (0 == access(paths[i], X_OK))
|
||||
{
|
||||
path = paths[i];
|
||||
break;
|
||||
}
|
||||
char *argv[] =
|
||||
{
|
||||
path,
|
||||
"-z",
|
||||
"-u",
|
||||
mountpoint,
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
//go:build !cgo && windows
|
||||
// +build !cgo,windows
|
||||
|
||||
/*
|
||||
|
@ -16,6 +17,7 @@ package fuse
|
|||
|
||||
import (
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"sync"
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
@ -539,9 +541,12 @@ func c_hostOptParse(args *c_struct_fuse_args, data unsafe.Pointer, opts *c_struc
|
|||
|
||||
func fspload() (dll *syscall.DLL, err error) {
|
||||
dllname := ""
|
||||
if uint64(0xffffffff) < uint64(^uintptr(0)) {
|
||||
switch runtime.GOARCH {
|
||||
case "arm64":
|
||||
dllname = "winfsp-a64.dll"
|
||||
case "amd64":
|
||||
dllname = "winfsp-x64.dll"
|
||||
} else {
|
||||
case "386":
|
||||
dllname = "winfsp-x86.dll"
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
//go:build darwin || freebsd || netbsd || openbsd || linux
|
||||
// +build darwin freebsd netbsd openbsd linux
|
||||
|
||||
/*
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
//go:build windows
|
||||
// +build windows
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue