diff options
author | bolshevik | 2018-04-17 20:33:04 +0200 |
---|---|---|
committer | rfjakob | 2018-04-17 20:33:04 +0200 |
commit | 12b32aa06c0475d60ee51b3753052ac2e4d09308 (patch) | |
tree | 2b880d5e2a96f0992e9ba0fc54df85a6a18969ae /internal/fusefrontend/xattr_linux.go | |
parent | 12832851c68ce6ba2907b5d5fefc2a5e49f7c36a (diff) |
Improved xattr handling on non-linux systems (#227)
* Fixed xattr filtering for MacOS. "system." and "user." prefixes are only relevant for Linux.
* Small cleanup and additional tests.
Diffstat (limited to 'internal/fusefrontend/xattr_linux.go')
-rw-r--r-- | internal/fusefrontend/xattr_linux.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/internal/fusefrontend/xattr_linux.go b/internal/fusefrontend/xattr_linux.go new file mode 100644 index 0000000..ebe42b1 --- /dev/null +++ b/internal/fusefrontend/xattr_linux.go @@ -0,0 +1,15 @@ +// +build linux + +// Package fusefrontend interfaces directly with the go-fuse library. +package fusefrontend + +import "strings" + +// Only allow the "user" namespace, block "trusted" and "security", as +// these may be interpreted by the system, and we don't want to cause +// trouble with our encrypted garbage. +const xattrUserPrefix = "user." + +func disallowedXAttrName(attr string) bool { + return !strings.HasPrefix(attr, xattrUserPrefix) +} |