libgocryptfs/internal/fusefrontend/xattr_linux.go
bolshevik 12b32aa06c 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.
2018-04-17 20:33:04 +02:00

16 lines
437 B
Go

// +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)
}