Windows: invalidate rdr for CM_SCACHE_VERSION_BAD

If the cm_scache_t.dataVersion is set to CM_SCACHE_VERSION_BAD,
invalidate the redirector notion of status so that we do not
leak info to users that do not have permission.

If the dataVersion is CM_SCACHE_VERSION_BAD and is updated
with real status info, invalidate the redirector so it attempts
to read the directory contents.

Change-Id: Iaa15b37f7f1863169ffe93ae9bc3d24086a3b734
Reviewed-on: http://gerrit.openafs.org/6159
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
This commit is contained in:
Jeffrey Altman 2011-11-30 23:29:56 -05:00 committed by Jeffrey Altman
parent 79833cbc64
commit 2aeb041bb0

View File

@ -1603,7 +1603,9 @@ void cm_MergeStatus(cm_scache_t *dscp,
scp->parentVnode = 0;
scp->parentUnique = 0;
}
goto done;
if (RDR_Initialized)
rdr_invalidate = 1;
} else {
_InterlockedAnd(&scp->flags, ~CM_SCACHEFLAG_EACCESS);
}
@ -1804,8 +1806,10 @@ void cm_MergeStatus(cm_scache_t *dscp,
scp->bufDataVersionLow == 0)
scp->bufDataVersionLow = dataVersion;
if (RDR_Initialized && scp->dataVersion != CM_SCACHE_VERSION_BAD) {
if ( ( !(reqp->flags & CM_REQ_SOURCE_REDIR) || !(flags & (CM_MERGEFLAG_DIROP|CM_MERGEFLAG_STOREDATA))) &&
if (RDR_Initialized) {
if (scp->dataVersion != CM_SCACHE_VERSION_BAD) {
rdr_invalidate = 1;
} else if ( ( !(reqp->flags & CM_REQ_SOURCE_REDIR) || !(flags & (CM_MERGEFLAG_DIROP|CM_MERGEFLAG_STOREDATA))) &&
scp->dataVersion != dataVersion && (dataVersion - scp->dataVersion > activeRPCs - 1)) {
rdr_invalidate = 1;
} else if ( (reqp->flags & CM_REQ_SOURCE_REDIR) && (flags & (CM_MERGEFLAG_DIROP|CM_MERGEFLAG_STOREDATA)) &&