From: Casey Bodley Date: Wed, 26 Jul 2017 20:26:25 +0000 (-0400) Subject: rgw: rgwx-skip-decrypt header bypasses decryption filter on GetObj X-Git-Tag: v13.0.0~19^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=adf7a333017f52682c7319420804433b7d3851a0;p=ceph.git rgw: rgwx-skip-decrypt header bypasses decryption filter on GetObj Fixes: http://tracker.ceph.com/issues/20668 Fixes: http://tracker.ceph.com/issues/20671 Signed-off-by: Casey Bodley --- diff --git a/src/rgw/rgw_op.h b/src/rgw/rgw_op.h index d3a63aee73d17..d9ce2b400011f 100644 --- a/src/rgw/rgw_op.h +++ b/src/rgw/rgw_op.h @@ -203,6 +203,7 @@ protected: bool partial_content; bool range_parsed; bool skip_manifest; + bool skip_decrypt{false}; rgw_obj obj; utime_t gc_invalidate_time; bool is_slo; diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index d005571fc9a15..024ac4a0229f5 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -129,6 +129,12 @@ int RGWGetObj_ObjStore_S3::get_params() // all of the data from its parts. the parts will sync as separate objects skip_manifest = s->info.args.exists(RGW_SYS_PARAM_PREFIX "sync-manifest"); + // multisite sync requests should fetch encrypted data, along with the + // attributes needed to support decryption on the other zone + if (s->system_request) { + skip_decrypt = s->info.args.exists(RGW_SYS_PARAM_PREFIX "skip-decrypt"); + } + return RGWGetObj_ObjStore::get_params(); } @@ -337,6 +343,10 @@ send_data: int RGWGetObj_ObjStore_S3::get_decrypt_filter(std::unique_ptr *filter, RGWGetDataCB* cb, bufferlist* manifest_bl) { + if (skip_decrypt) { // bypass decryption for multisite sync requests + return 0; + } + int res = 0; std::unique_ptr block_crypt; res = rgw_s3_prepare_decrypt(s, attrs, &block_crypt, crypt_http_responses);