From 23c197e370a7f94ed341f2ad3288aad00907272f Mon Sep 17 00:00:00 2001 From: Pritha Srivastava Date: Fri, 16 Apr 2021 13:58:27 +0530 Subject: [PATCH] rgw: fix for mfa resync crash when supplied with only one totp_pin. The fix returns an appropriate error message. fixes: https://tracker.ceph.com/issues/50394 Signed-off-by: Pritha Srivastava (cherry picked from commit 1b943419c45a9b17be71668bd023aeb814171b2c) --- src/rgw/rgw_admin.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index a57e2cacd7bed..451e49526fb74 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -2753,8 +2753,6 @@ static int scan_totp(CephContext *cct, ceph::real_time& now, rados::cls::otp::ot time_t *pofs) { #define MAX_TOTP_SKEW_HOURS (24 * 7) - ceph_assert(pins.size() == 2); - time_t start_time = ceph::real_clock::to_time_t(now); time_t time_ofs = 0, time_ofs_abs = 0; time_t step_size = totp.step_size; @@ -9121,6 +9119,7 @@ next: if (totp_pin.size() != 2) { cerr << "ERROR: missing two --totp-pin params (--totp-pin= --totp-pin=)" << std::endl; + return EINVAL; } rados::cls::otp::otp_info_t config; -- 2.39.5