From e207f928df747c03dc3c24b2c02013f357f361e6 Mon Sep 17 00:00:00 2001 From: Vikhyat Umrao Date: Fri, 1 May 2020 08:28:55 -0700 Subject: [PATCH] rgw/rgw_bucket: clear tenant string for non tenanted buckets in rgw_bucket_parse_bucket_key function. Fixes: https://tracker.ceph.com/issues/45355 Signed-off-by: Vikhyat Umrao (cherry picked from commit 6c4594a6aa6db0aee05287a82eaa937f715dc8b0) --- src/rgw/rgw_bucket.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/rgw/rgw_bucket.cc b/src/rgw/rgw_bucket.cc index 58b22827a59a4..2e1e8b39ac2ad 100644 --- a/src/rgw/rgw_bucket.cc +++ b/src/rgw/rgw_bucket.cc @@ -207,6 +207,8 @@ int rgw_bucket_parse_bucket_key(CephContext *cct, const string& key, auto tenant = name.substr(0, pos); bucket->tenant.assign(tenant.begin(), tenant.end()); name = name.substr(pos + 1); + } else { + bucket->tenant.clear(); } // split name:instance -- 2.39.5