From 4fa01ad7fc5434ca5ca42f30407d47c736f8b000 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Wed, 21 Dec 2011 21:34:14 -0500 Subject: [PATCH] Windows: AFSRequestExtentsAsync retry with alt authgroup If AFSRequestExtentsAsync() fails to obtain requested extents due to STATUS_ACCESS_DENIED using the AuthGroup associated with the Context Control Block, try to find an alternate AuthGroup to use to perform the extent request. We have already told Windows what permissions the application has when the file was opened. Windows will perform its own validation checks prior to permitting the data to be accessed or altered. Change-Id: I430657e8c8e30c9f636a5ec81065af4122c926d7 Reviewed-on: http://gerrit.openafs.org/6397 Tested-by: BuildBot Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- .../afsrdr/kernel/lib/AFSExtentsSupport.cpp | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/WINNT/afsrdr/kernel/lib/AFSExtentsSupport.cpp b/src/WINNT/afsrdr/kernel/lib/AFSExtentsSupport.cpp index 9d702b587..13c0d836b 100644 --- a/src/WINNT/afsrdr/kernel/lib/AFSExtentsSupport.cpp +++ b/src/WINNT/afsrdr/kernel/lib/AFSExtentsSupport.cpp @@ -798,6 +798,34 @@ AFSRequestExtentsAsync( IN AFSFcb *Fcb, NULL, NULL); + if ( ntStatus == STATUS_ACCESS_DENIED) + { + GUID stAuthGroup; + DWORD ntStatus2; + + ntStatus2 = AFSRetrieveValidAuthGroup( Fcb, + NULL, + TRUE, + &stAuthGroup); + + if ( NT_SUCCESS( ntStatus2) && + RtlCompareMemory( &stAuthGroup, + &Ccb->AuthGroup, + sizeof( GUID)) != sizeof( GUID)) + { + + ntStatus = AFSProcessRequest( AFS_REQUEST_TYPE_REQUEST_FILE_EXTENTS, + 0, + &stAuthGroup, + NULL, + &Fcb->ObjectInformation->FileId, + &request, + sizeof( AFSRequestExtentsCB ), + NULL, + NULL); + } + } + if( NT_SUCCESS( ntStatus)) { -- 2.39.5