From 5263b04796dfae34b2ac52e420bdc2f0c70e0568 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Thu, 15 Sep 2011 14:00:39 -0400 Subject: [PATCH] windows: Set ReparsePoint Attribute in FileAttributes The ReparsePoint Attribute is a primary attribute that is used internally within the redirector to determine when the object is a reparse point. It must be set in all code paths that obtain the FileAttributes from the service. Do not fold it in during the QueryBasicInformation response processing. Change-Id: Iba819dd94ec03133f78a4d18559dbd1b5352788e Reviewed-on: http://gerrit.openafs.org/5448 Reviewed-by: Peter Scott Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- src/WINNT/afsrdr/kernel/lib/AFSCreate.cpp | 13 +++++++++++++ src/WINNT/afsrdr/kernel/lib/AFSFileInfo.cpp | 7 ------- src/WINNT/afsrdr/kernel/lib/AFSGeneric.cpp | 16 ++++++++++++++++ 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/src/WINNT/afsrdr/kernel/lib/AFSCreate.cpp b/src/WINNT/afsrdr/kernel/lib/AFSCreate.cpp index 72343c6ff..63f25342a 100644 --- a/src/WINNT/afsrdr/kernel/lib/AFSCreate.cpp +++ b/src/WINNT/afsrdr/kernel/lib/AFSCreate.cpp @@ -641,6 +641,19 @@ AFSCommonCreate( IN PDEVICE_OBJECT DeviceObject, try_return( ntStatus); } + if ( BooleanFlagOn( ulOptions, FILE_OPEN_REPARSE_POINT) && + pDirectoryCB != NULL && + !BooleanFlagOn( pDirectoryCB->ObjectInformation->FileAttributes, FILE_ATTRIBUTE_REPARSE_POINT)) + { + + AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING, + AFS_TRACE_LEVEL_VERBOSE, + "AFSCommonCreate (%08lX) Reparse open request but attribute not set for %wZ Type %08lX\n", + Irp, + &uniFileName, + pDirectoryCB->ObjectInformation->FileType); + } + // // Based on the options passed in, process the file accordingly. // diff --git a/src/WINNT/afsrdr/kernel/lib/AFSFileInfo.cpp b/src/WINNT/afsrdr/kernel/lib/AFSFileInfo.cpp index cad48b82f..27e508db1 100644 --- a/src/WINNT/afsrdr/kernel/lib/AFSFileInfo.cpp +++ b/src/WINNT/afsrdr/kernel/lib/AFSFileInfo.cpp @@ -1474,13 +1474,6 @@ AFSSetBasicInfo( IN PIRP Irp, pBuffer->FileAttributes |= FILE_ATTRIBUTE_DIRECTORY; } - if( DirectoryCB->ObjectInformation->Fcb->Header.NodeTypeCode == AFS_SYMBOLIC_LINK_FCB || - DirectoryCB->ObjectInformation->Fcb->Header.NodeTypeCode == AFS_MOUNT_POINT_FCB || - DirectoryCB->ObjectInformation->Fcb->Header.NodeTypeCode == AFS_DFS_LINK_FCB) - { - pBuffer->FileAttributes |= FILE_ATTRIBUTE_REPARSE_POINT; - } - pCcb->FileUnwindInfo.FileAttributes = DirectoryCB->ObjectInformation->FileAttributes; DirectoryCB->ObjectInformation->FileAttributes = pBuffer->FileAttributes; diff --git a/src/WINNT/afsrdr/kernel/lib/AFSGeneric.cpp b/src/WINNT/afsrdr/kernel/lib/AFSGeneric.cpp index 54b3b4fb2..d40b824b1 100644 --- a/src/WINNT/afsrdr/kernel/lib/AFSGeneric.cpp +++ b/src/WINNT/afsrdr/kernel/lib/AFSGeneric.cpp @@ -1392,6 +1392,14 @@ AFSEvaluateNode( IN GUID *AuthGroup, DirEntry->ObjectInformation->FileAttributes = pDirEntry->FileAttributes; + if( pDirEntry->FileType == AFS_FILE_TYPE_MOUNTPOINT || + pDirEntry->FileType == AFS_FILE_TYPE_SYMLINK || + pDirEntry->FileType == AFS_FILE_TYPE_DFSLINK) + { + + DirEntry->ObjectInformation->FileAttributes |= FILE_ATTRIBUTE_REPARSE_POINT; + } + DirEntry->ObjectInformation->EaSize = pDirEntry->EaSize; DirEntry->ObjectInformation->Links = pDirEntry->Links; @@ -1564,6 +1572,14 @@ AFSValidateSymLink( IN GUID *AuthGroup, DirEntry->ObjectInformation->FileAttributes = pDirEntry->FileAttributes; + if( pDirEntry->FileType == AFS_FILE_TYPE_MOUNTPOINT || + pDirEntry->FileType == AFS_FILE_TYPE_SYMLINK || + pDirEntry->FileType == AFS_FILE_TYPE_DFSLINK) + { + + DirEntry->ObjectInformation->FileAttributes |= FILE_ATTRIBUTE_REPARSE_POINT; + } + DirEntry->ObjectInformation->EaSize = pDirEntry->EaSize; DirEntry->ObjectInformation->Links = pDirEntry->Links; -- 2.39.5