From: Tobias Urdin Date: Thu, 18 Jan 2024 08:15:51 +0000 (+0000) Subject: rgw: fix http error check in keystone issue_admin_token_request X-Git-Tag: v19.3.0~93^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7edfa3f2fb145253a49c155847212097b3bfb9da;p=ceph.git rgw: fix http error check in keystone issue_admin_token_request This changes so that we don't return before even checking if the request failed by checking the response code like was done for other methods in [1]. [1] https://github.com/ceph/ceph/pull/53846 Signed-off-by: Tobias Urdin --- diff --git a/src/rgw/rgw_keystone.cc b/src/rgw/rgw_keystone.cc index 7d5264f980e..e6fbeea71b4 100644 --- a/src/rgw/rgw_keystone.cc +++ b/src/rgw/rgw_keystone.cc @@ -211,9 +211,6 @@ int Service::issue_admin_token_request(const DoutPrefixProvider *dpp, token_req.set_url(token_url); const int ret = token_req.process(y); - if (ret < 0) { - return ret; - } /* Detect rejection earlier than during the token parsing step. */ if (token_req.get_http_status() == @@ -221,6 +218,11 @@ int Service::issue_admin_token_request(const DoutPrefixProvider *dpp, return -EACCES; } + // throw any other http or connection errors + if (ret < 0) { + return ret; + } + if (t.parse(dpp, token_req.get_subject_token(), token_bl, keystone_version) != 0) { return -EINVAL;