From 4364f4dfe32447201a05f872fd5595dd82a69792 Mon Sep 17 00:00:00 2001 From: "changlin.shi" Date: Fri, 11 Nov 2022 10:02:39 +0800 Subject: [PATCH] don't set acp when ownership is BucketOwnerEnfored Signed-off-by: changlin.shi --- weed/s3api/s3api_acp.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/weed/s3api/s3api_acp.go b/weed/s3api/s3api_acp.go index fbbf2d080..ca79cb6d2 100644 --- a/weed/s3api/s3api_acp.go +++ b/weed/s3api/s3api_acp.go @@ -61,19 +61,14 @@ func (s3a *S3ApiServer) checkAccessForWriteObject(r *http.Request, bucket, objec }, } if len(grants) == 0 { - // set default grants - s3acl.SetAcpOwnerHeader(r, accountId) - s3acl.SetAcpGrantsHeader(r, []*s3.Grant{bucketOwnerFullControlGrant}) return s3err.ErrNone } - if !s3acl.GrantEquals(bucketOwnerFullControlGrant, grants[0]) { - return s3err.AccessControlListNotSupported + if s3acl.GrantEquals(bucketOwnerFullControlGrant, grants[0]) { + return s3err.ErrNone } - s3acl.SetAcpOwnerHeader(r, accountId) - s3acl.SetAcpGrantsHeader(r, []*s3.Grant{bucketOwnerFullControlGrant}) - return s3err.ErrNone + return s3err.AccessControlListNotSupported } //bucket access allowed