]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/sts: fix inverted tokenCode length validation 69821/head
authorSun Yuechi <sunyuechi@iscas.ac.cn>
Tue, 30 Jun 2026 06:44:56 +0000 (14:44 +0800)
committerSun Yuechi <sunyuechi@iscas.ac.cn>
Wed, 1 Jul 2026 12:20:20 +0000 (20:20 +0800)
validate_input() rejected the valid TOKEN_CODE_SIZE length and accepted
all others. Compare with != so only a wrong length is rejected.

Fixes: https://tracker.ceph.com/issues/77872
Signed-off-by: Sun Yuechi <sunyuechi@iscas.ac.cn>
src/rgw/rgw_sts.cc

index 357a153e222d2fc60bdf6cf98afce013a8fe9350..ebf0d5140ba2b4a3cfa0798e00618b74963d21fa 100644 (file)
@@ -282,7 +282,7 @@ int AssumeRoleRequest::validate_input(const DoutPrefixProvider *dpp) const
       return -EINVAL;
     }
   }
-  if (! tokenCode.empty() && tokenCode.size() == TOKEN_CODE_SIZE) {
+  if (! tokenCode.empty() && tokenCode.size() != TOKEN_CODE_SIZE) {
     ldpp_dout(dpp, 0) << "Either token code is empty or token code size is invalid: " << tokenCode.size() << dendl;
     return -EINVAL;
   }