]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix for mfa resync crash when supplied with only one totp_pin. 40886/head
authorPritha Srivastava <prsrivas@redhat.com>
Fri, 16 Apr 2021 08:28:27 +0000 (13:58 +0530)
committerPritha Srivastava <prsrivas@redhat.com>
Fri, 16 Apr 2021 08:28:27 +0000 (13:58 +0530)
The fix returns an appropriate error message.

fixes: https://tracker.ceph.com/issues/50394

Signed-off-by: Pritha Srivastava <prsrivas@redhat.com>
src/rgw/rgw_admin.cc

index 916fac3dcf45d68f734c5b7db1edcf4db1db2700..bef6bd6ba89fe4fe367b4d2d1dbb50208a1b56c6 100644 (file)
@@ -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=<first> --totp-pin=<second>)" << std::endl;
+      return EINVAL;
     }
 
     rados::cls::otp::otp_info_t config;