summaryrefslogtreecommitdiffstats
path: root/src/rgw/rgw_rest_bucket_logging.cc
diff options
context:
space:
mode:
authorYuval Lifshitz <ylifshit@ibm.com>2024-12-19 12:54:54 +0100
committerYuval Lifshitz <ylifshit@ibm.com>2025-01-13 07:38:49 +0100
commit462edf385d0c6db49a0bf0ef8432133d7f6c6bb8 (patch)
treeb9ec5855c85f87e34d4da1bc203c5687e3e968cf /src/rgw/rgw_rest_bucket_logging.cc
parentrgw/logging: support source and destination buckets on different tenants (diff)
downloadceph-462edf385d0c6db49a0bf0ef8432133d7f6c6bb8.tar.xz
ceph-462edf385d0c6db49a0bf0ef8432133d7f6c6bb8.zip
rgw/logging: source and log bucket must be different
Signed-off-by: Yuval Lifshitz <ylifshit@ibm.com>
Diffstat (limited to '')
-rw-r--r--src/rgw/rgw_rest_bucket_logging.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/rgw/rgw_rest_bucket_logging.cc b/src/rgw/rgw_rest_bucket_logging.cc
index 0e7b53120db..5689a7acc56 100644
--- a/src/rgw/rgw_rest_bucket_logging.cc
+++ b/src/rgw/rgw_rest_bucket_logging.cc
@@ -181,6 +181,11 @@ class RGWPutBucketLoggingOp : public RGWDefaultResponseOp {
return;
}
const rgw_bucket target_bucket_id(target_tenant_name, target_bucket_name);
+ if (target_bucket_id == src_bucket_id) {
+ ldpp_dout(this, 1) << "ERROR: target bucket '" << target_bucket_id << "' must be different from source bucket" << dendl;
+ op_ret = -EINVAL;
+ return;
+ }
std::unique_ptr<rgw::sal::Bucket> target_bucket;
op_ret = driver->load_bucket(this, target_bucket_id,
&target_bucket, y);