From b7174ca14091c09d3e168ff20493532e44215ac2 Mon Sep 17 00:00:00 2001 From: Yuval Lifshitz Date: Thu, 19 Dec 2024 13:49:07 +0000 Subject: [PATCH] rgw/logging: log bucket must not have encryption Signed-off-by: Yuval Lifshitz --- src/rgw/rgw_rest_bucket_logging.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_rest_bucket_logging.cc b/src/rgw/rgw_rest_bucket_logging.cc index 5689a7acc56..b2676fc3bec 100644 --- a/src/rgw/rgw_rest_bucket_logging.cc +++ b/src/rgw/rgw_rest_bucket_logging.cc @@ -200,7 +200,12 @@ class RGWPutBucketLoggingOp : public RGWDefaultResponseOp { op_ret = -EINVAL; return; } - // TODO: verify target bucket does not have encryption + // verify target bucket does not have encryption + if (target_attrs.find(RGW_ATTR_BUCKET_ENCRYPTION_POLICY) != target_attrs.end()) { + ldpp_dout(this, 1) << "ERROR: logging target bucket '" << target_bucket_id << "', is configured with encryption" << dendl; + op_ret = -EINVAL; + return; + } bufferlist conf_bl; encode(configuration, conf_bl); attrs[RGW_ATTR_BUCKET_LOGGING] = conf_bl; -- 2.39.5