Skip to content

Commit 4fa6af2

Browse files
authored
Merge pull request ceph#55727 from cbodley/wip-64549
rgw/auth: do_aws4_auth_completion() catches exceptions Reviewed-by: Matt Benjamin <[email protected]>
2 parents 93ace0d + f953c41 commit 4fa6af2

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/rgw/rgw_op.cc

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,16 +1407,20 @@ int RGWOp::do_aws4_auth_completion()
14071407
{
14081408
ldpp_dout(this, 5) << "NOTICE: call to do_aws4_auth_completion" << dendl;
14091409
if (s->auth.completer) {
1410-
if (!s->auth.completer->complete()) {
1411-
return -ERR_AMZ_CONTENT_SHA256_MISMATCH;
1412-
} else {
1413-
ldpp_dout(this, 10) << "v4 auth ok -- do_aws4_auth_completion" << dendl;
1414-
}
1415-
14161410
/* TODO(rzarzynski): yes, we're really called twice on PUTs. Only first
14171411
* call passes, so we disable second one. This is old behaviour, sorry!
14181412
* Plan for tomorrow: seek and destroy. */
1419-
s->auth.completer = nullptr;
1413+
auto completer = std::move(s->auth.completer);
1414+
1415+
try {
1416+
if (!completer->complete()) {
1417+
return -ERR_AMZ_CONTENT_SHA256_MISMATCH;
1418+
}
1419+
} catch (const rgw::io::Exception& e) {
1420+
return -e.code().value();
1421+
}
1422+
1423+
ldpp_dout(this, 10) << "v4 auth ok -- do_aws4_auth_completion" << dendl;
14201424
}
14211425

14221426
return 0;

0 commit comments

Comments
 (0)