From: Tobias Urdin Date: Sun, 8 May 2022 18:29:32 +0000 (+0000) Subject: rgw/auth: Use time_t for new expires and dont static_cast X-Git-Tag: v18.1.0~1023^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ca7b83b4f10b98baa3b0d08b7af97569039df72b;p=ceph.git rgw/auth: Use time_t for new expires and dont static_cast Signed-off-by: Tobias Urdin --- diff --git a/src/rgw/rgw_auth_keystone.cc b/src/rgw/rgw_auth_keystone.cc index fdd9e91fac53..74c8c5310cd4 100644 --- a/src/rgw/rgw_auth_keystone.cc +++ b/src/rgw/rgw_auth_keystone.cc @@ -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(new_expires)); + t->set_expires(new_expires); } ldpp_dout(dpp, 0) << "validated token: " << t->get_project_name() << ":" << t->get_user_name()