From: Vedansh Bhartia Date: Sun, 16 Jul 2023 04:52:42 +0000 (+0530) Subject: rgw: When finding bucket owner info, handle account name being empty X-Git-Tag: v19.0.0~824^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9ce3bcc12a667d83efa5e22bc2abb852b8c2a15f;p=ceph.git rgw: When finding bucket owner info, handle account name being empty Signed-off-by: Vedansh Bhartia --- diff --git a/src/rgw/rgw_rest_swift.cc b/src/rgw/rgw_rest_swift.cc index dc28b77090a3..11e7c647c7d9 100644 --- a/src/rgw/rgw_rest_swift.cc +++ b/src/rgw/rgw_rest_swift.cc @@ -2081,6 +2081,7 @@ void RGWFormPost::get_owner_info(const req_state* const s, const string& bucket_name = s->init_state.url_bucket; std::unique_ptr user; + std::string bucket_tenant; /* TempURL in Formpost only requires that bucket name is specified. */ if (bucket_name.empty()) { @@ -2108,11 +2109,13 @@ void RGWFormPost::get_owner_info(const req_state* const s, throw -EPERM; } } + + bucket_tenant = user->get_tenant(); } /* Need to get user info of bucket owner. */ std::unique_ptr bucket; - int ret = driver->get_bucket(s, user.get(), user->get_tenant(), bucket_name, &bucket, s->yield); + int ret = driver->get_bucket(s, user.get(), bucket_tenant, bucket_name, &bucket, s->yield); if (ret < 0) { throw ret; }