Windows: OpenAFS reparse points are surrogates
authorJeffrey Altman <jaltman@your-file-system.com>
Mon, 6 Feb 2012 17:00:58 +0000 (12:00 -0500)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 7 Feb 2012 20:03:02 +0000 (12:03 -0800)
OpenAFS reparse points represent mount points, symlinks, and dfs
referrals.  All of which are file system objects that represent
another named entity in the system.  As a result the reparse tag
field must include the Reparse Tag Surrogate bit (0x20000000) set.

This permits the IsReparseTagNameSurrogate() macro provided in
winnt.h to be used to determine if the reparse point is a surrogate
or not.

See
http://msdn.microsoft.com/en-us/library/windows/desktop/aa365197%28v=vs.85%29.aspx

Change-Id: I2561823e23371c2fdf01941da99fe848ca1fa11d
Reviewed-on: http://gerrit.openafs.org/6668
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

src/WINNT/afsrdr/kernel/lib/AFSFSControl.cpp
src/WINNT/afsrdr/kernel/lib/AFSFileInfo.cpp
src/WINNT/afsrdr/kernel/lib/Include/AFSDefines.h

index 29dc20f..b5768a9 100644 (file)
@@ -548,7 +548,7 @@ AFSProcessUserFsRequest( IN PIRP Irp)
 
                     ulRemainingLen -= pReparseBuffer->ReparseDataLength;
 
-                    pReparseBuffer->ReparseTag = IO_REPARSE_TAG_OPENAFS_DFS;
+                    pReparseBuffer->ReparseTag = IO_REPARSE_TAG_SURROGATE|IO_REPARSE_TAG_OPENAFS_DFS;
 
                     RtlCopyMemory( &pReparseBuffer->ReparseGuid,
                                    &GUID_AFS_REPARSE_GUID,
@@ -595,7 +595,7 @@ AFSProcessUserFsRequest( IN PIRP Irp)
                     break;
                 }
 
-                if( pReparseBuffer->ReparseTag != IO_REPARSE_TAG_OPENAFS_DFS)
+                if( (pReparseBuffer->ReparseTag & 0x0000FFFF) != IO_REPARSE_TAG_OPENAFS_DFS)
                 {
 
                     ntStatus = STATUS_IO_REPARSE_TAG_MISMATCH;
@@ -654,7 +654,7 @@ AFSProcessUserFsRequest( IN PIRP Irp)
                     break;
                 }
 
-                if( pReparseBuffer->ReparseTag != IO_REPARSE_TAG_OPENAFS_DFS)
+                if( (pReparseBuffer->ReparseTag & 0x0000FFFF) != IO_REPARSE_TAG_OPENAFS_DFS)
                 {
 
                     ntStatus = STATUS_IO_REPARSE_TAG_MISMATCH;
index ba96adf..eb643b3 100644 (file)
@@ -1622,7 +1622,7 @@ AFSQueryAttribTagInfo( IN PIRP Irp,
 
         if( BooleanFlagOn( DirectoryCB->ObjectInformation->FileAttributes, FILE_ATTRIBUTE_REPARSE_POINT))
         {
-            Buffer->ReparseTag = IO_REPARSE_TAG_OPENAFS_DFS;
+            Buffer->ReparseTag = IO_REPARSE_TAG_SURROGATE|IO_REPARSE_TAG_OPENAFS_DFS;
         }
 
         *Length -= sizeof( FILE_ATTRIBUTE_TAG_INFORMATION);
index b4bde8a..fc5dc2c 100644 (file)
@@ -434,6 +434,10 @@ DEFINE_GUID (GUID_SD_AFS_REDIRECTOR_CONTROL_OBJECT,
 #define IO_REPARSE_TAG_OPENAFS_DFS              0x00000037L
 #endif
 
+#ifndef IO_REPARSE_TAG_SURROGATE
+#define IO_REPARSE_TAG_SURROGATE                0x20000000L
+#endif
+
 //  {EF21A155-5C92-4470-AB3B-370403D96369}
 DEFINE_GUID (GUID_AFS_REPARSE_GUID,
         0xEF21A155, 0x5C92, 0x4470, 0xAB, 0x3B, 0x37, 0x04, 0x03, 0xD9, 0x63, 0x69);