]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/auth: Use time_t for new expires and dont static_cast
authorTobias Urdin <tobias.urdin@binero.se>
Sun, 8 May 2022 18:29:32 +0000 (18:29 +0000)
committerTobias Urdin <tobias.urdin@binero.se>
Wed, 21 Sep 2022 20:33:29 +0000 (20:33 +0000)
Signed-off-by: Tobias Urdin <tobias.urdin@binero.com>
src/rgw/rgw_auth_keystone.cc

index fdd9e91fac530a5ac1260d04b497752865cd459d..74c8c5310cd42be6b9384481c8328d9e8a51641c 100644 (file)
@@ -335,14 +335,14 @@ TokenEngine::authenticate(const DoutPrefixProvider* dpp,
       /* If this token was an allowed expired token because we got a
        * service token we need to update the expiration before we cache it. */
       if (allow_expired) {
-        uint64_t now = ceph_clock_now().sec();
-        uint64_t new_expires = now + g_conf()->rgw_keystone_expired_token_cache_expiration;
+        time_t now = ceph_clock_now().sec();
+        time_t new_expires = now + g_conf()->rgw_keystone_expired_token_cache_expiration;
         ldpp_dout(dpp, 20) << "updating expiration of allowed expired token"
                            << " from old " << t->get_expires() << " to now " << now << " + "
                            << g_conf()->rgw_keystone_expired_token_cache_expiration
                            << " secs = "
                            << new_expires << dendl;
-        t->set_expires(static_cast<time_t>(new_expires));
+        t->set_expires(new_expires);
       }
       ldpp_dout(dpp, 0) << "validated token: " << t->get_project_name()
                     << ":" << t->get_user_name()