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

eos: do not read user ACLs any longer #4892

Merged
merged 2 commits into from
Oct 29, 2024
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
6 changes: 6 additions & 0 deletions changelog/unreleased/eos-useracl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Enhancement: do not read eos user ACLs any longer

This PR drops the compatibility code to read eos user ACLs
in the eos binary client, and aligns it to the GRPC client.

https://github.com/cs3org/reva/pull/4892
22 changes: 2 additions & 20 deletions pkg/eosclient/eosbinary/eosbinary.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ import (
)

const (
versionPrefix = ".sys.v#."
userACLEvalKey = "eval.useracl"
favoritesKey = "http://owncloud.org/ns/favorite"
versionPrefix = ".sys.v#."
favoritesKey = "http://owncloud.org/ns/favorite"
)

func serializeAttribute(a *eosclient.Attribute) string {
Expand Down Expand Up @@ -1226,23 +1225,6 @@ func (c *Client) mapToFileInfo(ctx context.Context, kv, attrs map[string]string,
return nil, err
}

// Temporary until we migrate the user ACLs to sys ACLs on our MGMs
// Read user ACLs if sys.eval.useracl is set
if userACLEval, ok := attrs["sys."+userACLEvalKey]; ok && userACLEval == "1" {
if userACL, ok := attrs["user.acl"]; ok {
userAcls, err := acl.Parse(userACL, acl.ShortTextForm)
if err != nil {
return nil, err
}
for _, e := range userAcls.Entries {
err = sysACL.SetEntry(e.Type, e.Qualifier, e.Permissions)
if err != nil {
return nil, err
}
}
}
}

// Read the favorite attr
if parseFavoriteKey {
parseAndSetFavoriteAttr(ctx, attrs)
Expand Down
Loading