From cf4cf2c1b735cabc5ccb5d13215a7b85ee68fd2e Mon Sep 17 00:00:00 2001 From: Abhishek Lekshmanan Date: Thu, 23 Jul 2020 11:51:24 +0200 Subject: [PATCH] rgw: s3: mark bucket encryption as not implemented Currently otherwise this op in deletion would delete the bucket instead Fixes: https://tracker.ceph.com/issues/46263 Signed-off-by: Abhishek Lekshmanan --- src/rgw/rgw_rest_s3.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index 3615f781af26..fd413b53bfce 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -4378,6 +4378,9 @@ RGWOp *RGWHandler_REST_Bucket_S3::get_obj_op(bool get_data) const RGWOp *RGWHandler_REST_Bucket_S3::op_get() { + if (s->info.args.sub_resource_exists("encryption")) + return nullptr; + if (s->info.args.sub_resource_exists("logging")) return new RGWGetBucketLogging_ObjStore_S3; @@ -4438,8 +4441,9 @@ RGWOp *RGWHandler_REST_Bucket_S3::op_head() RGWOp *RGWHandler_REST_Bucket_S3::op_put() { - if (s->info.args.sub_resource_exists("logging")) - return NULL; + if (s->info.args.sub_resource_exists("logging") || + s->info.args.sub_resource_exists("encryption")) + return nullptr; if (s->info.args.sub_resource_exists("versioning")) return new RGWSetBucketVersioning_ObjStore_S3; if (s->info.args.sub_resource_exists("website")) { @@ -4480,6 +4484,10 @@ RGWOp *RGWHandler_REST_Bucket_S3::op_put() RGWOp *RGWHandler_REST_Bucket_S3::op_delete() { + if (s->info.args.sub_resource_exists("logging") || + s->info.args.sub_resource_exists("encryption")) + return nullptr; + if (is_tagging_op()) { return new RGWDeleteBucketTags_ObjStore_S3; } else if (is_cors_op()) { -- 2.47.3