diff --git a/changelog/unreleased/freebsd-xattr-support.md b/changelog/unreleased/freebsd-xattr-support.md new file mode 100644 index 0000000000..adac064195 --- /dev/null +++ b/changelog/unreleased/freebsd-xattr-support.md @@ -0,0 +1,5 @@ +Bugfix: FreeBSD xattr support + +We now properly handle FreeBSD xattr namespaces by leaving out the `user.` prefix. FreeBSD adds that automatically. + +https://github.com/cs3org/reva/pull/3650 \ No newline at end of file diff --git a/pkg/storage/utils/decomposedfs/xattrs/xattrs.go b/pkg/storage/utils/decomposedfs/xattrs/xattrs.go index 496071b37a..695a5a3854 100644 --- a/pkg/storage/utils/decomposedfs/xattrs/xattrs.go +++ b/pkg/storage/utils/decomposedfs/xattrs/xattrs.go @@ -36,9 +36,8 @@ import ( // A non root user can only manipulate the user. namespace, which is what // we will use to store ownCloud specific metadata. To prevent name // collisions with other apps We are going to introduce a sub namespace -// "user.ocis." +// "user.ocis." in the xattrs_prefix*.go files. const ( - OcisPrefix string = "user.ocis." ParentidAttr string = OcisPrefix + "parentid" OwnerIDAttr string = OcisPrefix + "owner.id" OwnerIDPAttr string = OcisPrefix + "owner.idp" diff --git a/pkg/storage/utils/decomposedfs/xattrs/xattrs_prefix.go b/pkg/storage/utils/decomposedfs/xattrs/xattrs_prefix.go new file mode 100644 index 0000000000..c8277ae58c --- /dev/null +++ b/pkg/storage/utils/decomposedfs/xattrs/xattrs_prefix.go @@ -0,0 +1,11 @@ +//go:build !freebsd + +package xattrs + +// The default namespace for ocis. As non root users can only manipulate +// the user. namespace, which is what is used to store ownCloud specific +// metadata. To prevent name collisions with other apps, we are going to +// introduce a sub namespace "user.ocis." +const ( + OcisPrefix string = "user.ocis." +) diff --git a/pkg/storage/utils/decomposedfs/xattrs/xattrs_prefix_freebsd.go b/pkg/storage/utils/decomposedfs/xattrs/xattrs_prefix_freebsd.go new file mode 100644 index 0000000000..4dd2323590 --- /dev/null +++ b/pkg/storage/utils/decomposedfs/xattrs/xattrs_prefix_freebsd.go @@ -0,0 +1,10 @@ +//go:build freebsd + +package xattrs + +// On FreeBSD the `user` namespace is implied through a separate syscall argument +// and will fail with invalid argument when you try to start an xattr name with user. or system. +// For that reason we drop the superfluous user. prefix for FreeBSD specifically. +const ( + OcisPrefix string = "ocis." +)