Преглед на файлове

Merge pull request #11440 from RussWhitehead/cacheTimeout

HPCC-20118 LDAP Resource cache incorrectly thinks entries are stale

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman преди 6 години
родител
ревизия
04db997987
променени са 1 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. 3 3
      system/security/shared/caching.cpp

+ 3 - 3
system/security/shared/caching.cpp

@@ -79,14 +79,14 @@ int CResPermissionsCache::lookup( IArrayOf<ISecResource>& resources, bool* pFoun
         if (it != m_resAccessMap.end())//exists in cache
         {
             ResPermCacheEntry& resParamCacheEntry = (*it).second;
-            const time_t timestamp = resParamCacheEntry.first;
+            const time_t timeExpiry = resParamCacheEntry.first + m_pParentCache->getCacheTimeout();
 
-            if (timestamp < tstamp)//entry was not stale during last cleanup but is stale now
+            if (timeExpiry < tstamp)//entry was not stale during last cleanup but is stale now
                 *pFound++ = false;
             else if(!m_pParentCache->isCacheEnabled() && m_pParentCache->isTransactionalEnabled())//m_pParentCache->getOriginalTimeout() == 0)
             {
                 time_t tctime = getThreadCreateTime();
-                if(tctime <= 0 || timestamp < tctime)
+                if(tctime <= 0 || timeExpiry < tctime)
                 {
                     *pFound++ = false;
                 }