Skip to content

Commit

Permalink
rgw/sse-s3: fix bucket encryption of multipart upload
Browse files Browse the repository at this point in the history
Multipart upload missing encryption when we have bucket encryption
policy. Fix it by fetching bucket encryption policy and resolving
defaults at multipart init op.

Fixes: 464fda8.

Signed-off-by: Tongliang Deng <dengtongliang@gmail.com>
  • Loading branch information
5cs committed Dec 13, 2022
1 parent 1aa2887 commit 8c67720
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/rgw/rgw_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6225,8 +6225,10 @@ void RGWInitMultipart::execute(optional_yield y)
bufferlist aclbl, tracebl;
rgw::sal::Attrs attrs;

if (get_params(y) < 0)
op_ret = get_params(y);
if (op_ret < 0) {
return;
}

if (rgw::sal::Object::empty(s->object.get()))
return;
Expand Down
15 changes: 12 additions & 3 deletions src/rgw/rgw_rest_s3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3876,10 +3876,19 @@ void RGWSetRequestPayment_ObjStore_S3::send_response()

int RGWInitMultipart_ObjStore_S3::get_params(optional_yield y)
{
int ret;

map_qs_metadata(s, true);
ret = get_encryption_defaults(s);
if (ret < 0) {
ldpp_dout(this, 5) << __func__ << "(): get_encryption_defaults() returned ret=" << ret << dendl;
return ret;
}

RGWAccessControlPolicy_S3 s3policy(s->cct);
op_ret = create_s3_policy(s, driver, s3policy, s->owner);
if (op_ret < 0)
return op_ret;
ret = create_s3_policy(s, driver, s3policy, s->owner);
if (ret < 0)
return ret;

policy = s3policy;

Expand Down

0 comments on commit 8c67720

Please sign in to comment.