Skip to content

Commit

Permalink
ensure bucket owner retains permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
rem7 committed May 15, 2024
1 parent 3ebd6c8 commit 2d4d922
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions concat.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ func (r *RecursiveConcat) mergePair(ctx context.Context, objectList []*S3Obj, tr
output, err := r.Client.CreateMultipartUpload(ctx, &s3.CreateMultipartUploadInput{
Bucket: aws.String(bucket),
Key: aws.String(key),
ACL: types.ObjectCannedACLBucketOwnerFullControl,
})
if err != nil {
return complete, err
Expand Down
1 change: 1 addition & 0 deletions extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ func extractRange(ctx context.Context, svc *s3.Client, bucket, key, dstBucket, d
output, err := svc.CreateMultipartUpload(ctx, &s3.CreateMultipartUploadInput{
Bucket: aws.String(dstBucket),
Key: aws.String(dstKey),
ACL: types.ObjectCannedACLBucketOwnerFullControl,
})
if err != nil {
return err
Expand Down
1 change: 1 addition & 0 deletions mem_concat.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func buildInMemoryConcat(ctx context.Context, client *s3.Client, objectList []*S
StorageClass: opts.storageClass,
ChecksumAlgorithm: types.ChecksumAlgorithmSha256,
Tagging: &tags,
ACL: types.ObjectCannedACLBucketOwnerFullControl,
})
if err != nil {
Errorf(ctx, "unable to create multipart")
Expand Down
2 changes: 2 additions & 0 deletions s3tar.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ func redistribute(ctx context.Context, client *s3.Client, obj *S3Obj, trimoffset
Key: aws.String(key),
StorageClass: storageClass,
Tagging: &tags,
ACL: types.ObjectCannedACLBucketOwnerFullControl,
})
if err != nil {
Infof(ctx, err.Error())
Expand Down Expand Up @@ -694,6 +695,7 @@ func concatObjects(ctx context.Context, client *s3.Client, trimFirstBytes int, o
output, err := client.CreateMultipartUpload(ctx, &s3.CreateMultipartUploadInput{
Bucket: &bucket,
Key: &key,
ACL: types.ObjectCannedACLBucketOwnerFullControl,
})
if err != nil {
return complete, err
Expand Down
2 changes: 1 addition & 1 deletion utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ func getObjectRange(ctx context.Context, svc *s3.Client, bucket, key string, sta
}
output, err := svc.GetObject(ctx, params)
if err != nil {
return output.Body, err
return nil, err
}
return output.Body, nil
}
Expand Down

0 comments on commit 2d4d922

Please sign in to comment.