From: Daniel Gryniewicz Date: Thu, 4 Mar 2021 16:18:54 +0000 (-0500) Subject: RGW - Fix TempURL user handling X-Git-Tag: v17.1.0~2699^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F39876%2Fhead;p=ceph.git RGW - Fix TempURL user handling Zipper brok user handling for TempURL, missing the fallback to untenentaed UID. Signed-off-by: Daniel Gryniewicz --- diff --git a/src/rgw/rgw_swift_auth.cc b/src/rgw/rgw_swift_auth.cc index 81e5c0093031..e174cac02cf4 100644 --- a/src/rgw/rgw_swift_auth.cc +++ b/src/rgw/rgw_swift_auth.cc @@ -85,16 +85,24 @@ void TempURLEngine::get_owner_info(const DoutPrefixProvider* dpp, const req_stat * the access would be limited to accounts with empty tenant. */ string bucket_tenant; if (!s->account_name.empty()) { + bool found = false; std::unique_ptr user; rgw_user uid(s->account_name); if (uid.tenant.empty()) { - uid.tenant = uid.id; + rgw_user tenanted_uid(uid.id, uid.id); + user = store->get_user(tenanted_uid); + if (user->load_by_id(dpp, s->yield) >= 0) { + /* Succeeded */ + found = true; + } } - user = store->get_user(uid); - if (user->load_by_id(dpp, s->yield) < 0) { - throw -EPERM; + if (!found) { + user = store->get_user(uid); + if (user->load_by_id(dpp, s->yield) < 0) { + throw -EPERM; + } } bucket_tenant = user->get_tenant(); @@ -117,6 +125,8 @@ void TempURLEngine::get_owner_info(const DoutPrefixProvider* dpp, const req_stat if (user->load_by_id(dpp, s->yield) < 0) { throw -EPERM; } + + owner_info = user->get_info(); } std::string TempURLEngine::convert_from_iso8601(std::string expires) const