diff options
author | sungjoon-koh <sungjoon_koh@linecorp.com> | 2024-09-27 09:31:26 +0200 |
---|---|---|
committer | sungjoon-koh <sungjoon_koh@linecorp.com> | 2024-10-01 03:51:22 +0200 |
commit | b8516bf6b91fb764064edab8c7ee6f7f4463705d (patch) | |
tree | 2ee3807ccfce204e0d393f86186bf80365a115ab /src/rgw/driver | |
parent | Merge pull request #57836 from guojidan/warn-pool-app (diff) | |
download | ceph-b8516bf6b91fb764064edab8c7ee6f7f4463705d.tar.xz ceph-b8516bf6b91fb764064edab8c7ee6f7f4463705d.zip |
rgw: decrypt multipart get part when encrypted
Copy crypt related attrs for get object with partNumber
Signed-off-by: sungjoon-koh <sungjoon_koh@linecorp.com>
Diffstat (limited to '')
-rw-r--r-- | src/rgw/driver/rados/rgw_rados.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/rgw/driver/rados/rgw_rados.cc b/src/rgw/driver/rados/rgw_rados.cc index 99751be392f..1ca40050d7b 100644 --- a/src/rgw/driver/rados/rgw_rados.cc +++ b/src/rgw/driver/rados/rgw_rados.cc @@ -6809,6 +6809,13 @@ int RGWRados::Object::Read::prepare(optional_yield y, const DoutPrefixProvider * RGWBucketInfo& bucket_info = source->get_bucket_info(); if (params.part_num) { + map<string, bufferlist> src_attrset; + for (auto& iter : astate->attrset) { + if (boost::algorithm::starts_with(iter.first, RGW_ATTR_CRYPT_PREFIX)) { + ldpp_dout(dpp, 4) << "get src crypt attr: " << iter.first << dendl; + src_attrset[iter.first] = iter.second; + } + } int parts_count = 0; // use the manifest to redirect to the requested part number r = get_part_obj_state(dpp, y, store, bucket_info, &source->get_ctx(), @@ -6831,6 +6838,13 @@ int RGWRados::Object::Read::prepare(optional_yield y, const DoutPrefixProvider * } else { params.parts_count = parts_count; } + + for (auto& iter : src_attrset) { + ldpp_dout(dpp, 4) << "copy crypt attr: " << iter.first << dendl; + if (astate->attrset.find(iter.first) == astate->attrset.end()) { + astate->attrset[iter.first] = std::move(iter.second); + } + } } state.obj = astate->obj; |