windows: Set ReparsePoint Attribute in FileAttributes
authorJeffrey Altman <jaltman@your-file-system.com>
Thu, 15 Sep 2011 18:00:39 +0000 (14:00 -0400)
committerJeffrey Altman <jaltman@openafs.org>
Thu, 15 Sep 2011 18:35:21 +0000 (11:35 -0700)
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 <pscott.kd@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

src/WINNT/afsrdr/kernel/lib/AFSCreate.cpp
src/WINNT/afsrdr/kernel/lib/AFSFileInfo.cpp
src/WINNT/afsrdr/kernel/lib/AFSGeneric.cpp

index 72343c6..63f2534 100644 (file)
@@ -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.
         //
index cad48b8..27e508d 100644 (file)
@@ -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;
index 54b3b4f..d40b824 100644 (file)
@@ -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;