Skip to content

Commit

Permalink
respect enableXattr flag
Browse files Browse the repository at this point in the history
  • Loading branch information
infeo committed Nov 21, 2023
1 parent baaeae3 commit e779511
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/main/java/org/cryptomator/frontend/fuse/ReadOnlyAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,14 @@
import java.util.Set;
import java.util.function.BooleanSupplier;

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;
Expand Down Expand Up @@ -88,15 +92,14 @@ public Errno errno() {

@Override
public Set<Operation> 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,
Expand All @@ -105,6 +108,11 @@ public Set<Operation> 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) {
Expand Down

0 comments on commit e779511

Please sign in to comment.