Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FreeBSD xattr support #3650

Merged
merged 4 commits into from
Feb 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changelog/unreleased/freebsd-xattr-support.md
Original file line number Diff line number Diff line change
@@ -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
3 changes: 1 addition & 2 deletions pkg/storage/utils/decomposedfs/xattrs/xattrs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
11 changes: 11 additions & 0 deletions pkg/storage/utils/decomposedfs/xattrs/xattrs_prefix.go
Original file line number Diff line number Diff line change
@@ -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."
)
10 changes: 10 additions & 0 deletions pkg/storage/utils/decomposedfs/xattrs/xattrs_prefix_freebsd.go
Original file line number Diff line number Diff line change
@@ -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."
)