aboutsummaryrefslogtreecommitdiff
path: root/weed/s3api/s3api_bucket_handlers.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-11-02 13:13:36 -0700
committerChris Lu <chris.lu@gmail.com>2021-11-02 13:13:36 -0700
commitb25661c6df5ac23110e2ae29315554d3511edacd (patch)
treecce662c532f7f784f9bb163d063816df66860a07 /weed/s3api/s3api_bucket_handlers.go
parent1b90d60765f9b5ef8c41b735047dd376bc70e2af (diff)
downloadseaweedfs-b25661c6df5ac23110e2ae29315554d3511edacd.tar.xz
seaweedfs-b25661c6df5ac23110e2ae29315554d3511edacd.zip
s3: skip permission checking for creating bucket if the bucket already exists
fix https://github.com/chrislusf/seaweedfs/issues/2417 Rclone was trying to create the bucket even though the bucket already exists.
Diffstat (limited to 'weed/s3api/s3api_bucket_handlers.go')
-rw-r--r--weed/s3api/s3api_bucket_handlers.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/weed/s3api/s3api_bucket_handlers.go b/weed/s3api/s3api_bucket_handlers.go
index e343830ff..1c5d45dfa 100644
--- a/weed/s3api/s3api_bucket_handlers.go
+++ b/weed/s3api/s3api_bucket_handlers.go
@@ -111,6 +111,11 @@ func (s3a *S3ApiServer) PutBucketHandler(w http.ResponseWriter, r *http.Request)
return
}
+ if _, errCode = s3a.iam.authRequest(r, s3_constants.ACTION_ADMIN); errCode != s3err.ErrNone {
+ s3err.WriteErrorResponse(w, r, errCode)
+ return
+ }
+
fn := func(entry *filer_pb.Entry) {
if identityId := r.Header.Get(xhttp.AmzIdentityId); identityId != "" {
if entry.Extended == nil {