From: Pritha Srivastava Date: Fri, 16 Apr 2021 08:28:27 +0000 (+0530) Subject: rgw: fix for mfa resync crash when supplied with only one totp_pin. X-Git-Tag: v17.1.0~2029^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F40886%2Fhead;p=ceph.git 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 --- diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index 916fac3dcf4..bef6bd6ba89 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -2732,8 +2732,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; @@ -9052,6 +9050,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;