diff --git a/src/main/java/org/cryptomator/frontend/fuse/ReadOnlyAdapter.java b/src/main/java/org/cryptomator/frontend/fuse/ReadOnlyAdapter.java index 0efc945..49c3248 100644 --- a/src/main/java/org/cryptomator/frontend/fuse/ReadOnlyAdapter.java +++ b/src/main/java/org/cryptomator/frontend/fuse/ReadOnlyAdapter.java @@ -36,10 +36,14 @@ import java.util.EnumSet; import java.util.Set; +import static org.cryptomator.jfuse.api.FuseOperations.Operation.GET_XATTR; +import static org.cryptomator.jfuse.api.FuseOperations.Operation.LIST_XATTR; + public sealed class ReadOnlyAdapter implements FuseNioAdapter permits ReadWriteAdapter { private static final Logger LOG = LoggerFactory.getLogger(ReadOnlyAdapter.class); private static final int BLOCKSIZE = 4096; + protected final Errno errno; protected final Path root; private final int maxFileNameLength; @@ -85,15 +89,14 @@ public Errno errno() { @Override public Set supportedOperations() { - // FIXME: respect enableXattr - return Set.of(Operation.ACCESS, + var supportedOps = EnumSet.of(Operation.ACCESS, Operation.CHMOD, Operation.CREATE, Operation.DESTROY, Operation.GET_ATTR, - Operation.GET_XATTR, + GET_XATTR, Operation.INIT, - Operation.LIST_XATTR, + LIST_XATTR, Operation.OPEN, Operation.OPEN_DIR, Operation.READ, @@ -102,6 +105,11 @@ public Set supportedOperations() { Operation.RELEASE, Operation.RELEASE_DIR, Operation.STATFS); + if (!enableXattr) { + supportedOps.remove(GET_XATTR); + supportedOps.remove(LIST_XATTR); + } + return supportedOps; } private String stripLeadingFrom(String string) { diff --git a/src/main/java/org/cryptomator/frontend/fuse/mount/WinFspMountProvider.java b/src/main/java/org/cryptomator/frontend/fuse/mount/WinFspMountProvider.java index 16824f4..666917a 100644 --- a/src/main/java/org/cryptomator/frontend/fuse/mount/WinFspMountProvider.java +++ b/src/main/java/org/cryptomator/frontend/fuse/mount/WinFspMountProvider.java @@ -119,7 +119,8 @@ public Mount mount() throws MountFailedException { var builder = Fuse.builder(); var libPath = WinfspUtil.getWinFspInstallDir() + "bin\\" + (OS_ARCH.contains("aarch64") ? "winfsp-a64.dll" : "winfsp-x64.dll"); builder.setLibraryPath(libPath); - var fuseAdapter = ReadWriteAdapter.create(builder.errno(), vfsRoot, FuseNioAdapter.DEFAULT_MAX_FILENAMELENGTH, FileNameTranscoder.transcoder(), true); + //xattr disabled due to https://github.com/cryptomator/fuse-nio-adapter/issues/86 + var fuseAdapter = ReadWriteAdapter.create(builder.errno(), vfsRoot, FuseNioAdapter.DEFAULT_MAX_FILENAMELENGTH, FileNameTranscoder.transcoder(), false); try { var fuse = builder.build(fuseAdapter); fuse.mount("fuse-nio-adapter", mountPoint, combinedMountFlags().toArray(String[]::new));