Windows: remember when a reparse point is opened

If the mount point or symlink is opened as a reparse point
we must remember that in the Ccb so that later reparse point
processing can be implemented properly.  For now remember
with the CCB_FLAG_MASK_OPENED_REPARSE_POINT flag.

Change-Id: I32997a85701a95a5be1402cdcd3335a938395760
Reviewed-on: http://gerrit.openafs.org/5791
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
This commit is contained in:
Peter Scott 2011-11-02 19:25:36 -04:00 committed by Jeffrey Altman
parent c7e2d84501
commit e39e8bb5b2
2 changed files with 21 additions and 8 deletions

View File

@ -145,6 +145,7 @@ AFSCommonCreate( IN PDEVICE_OBJECT DeviceObject,
ULONG ulParseFlags = 0;
GUID stAuthGroup;
ULONG ulNameProcessingFlags = 0;
BOOLEAN bOpenedReparsePoint = FALSE;
__Enter
{
@ -648,16 +649,22 @@ AFSCommonCreate( IN PDEVICE_OBJECT DeviceObject,
}
if ( BooleanFlagOn( ulOptions, FILE_OPEN_REPARSE_POINT) &&
pDirectoryCB != NULL &&
!BooleanFlagOn( pDirectoryCB->ObjectInformation->FileAttributes, FILE_ATTRIBUTE_REPARSE_POINT))
pDirectoryCB != NULL)
{
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);
if( !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);
}
else
{
bOpenedReparsePoint = TRUE;
}
}
//
@ -1052,6 +1059,11 @@ try_exit:
}
}
if( bOpenedReparsePoint)
{
SetFlag( pCcb->Flags, CCB_FLAG_MASK_OPENED_REPARSE_POINT);
}
AFSDbgLogMsg( AFS_SUBSYSTEM_DIRENTRY_REF_COUNTING,
AFS_TRACE_LEVEL_VERBOSE,
"AFSCreate Count on %wZ DE %p Ccb %p Cnt %d\n",

View File

@ -226,6 +226,7 @@ NTSTATUS
#define CCB_FLAG_RETURN_RELATIVE_ENTRIES 0x00000010
#define CCB_FLAGS_DIRECTORY_QUERY_MAPPED 0x00000020
#define CCB_FLAG_MASK_PIOCTL_QUERY 0x00000040
#define CCB_FLAG_MASK_OPENED_REPARSE_POINT 0x00000080
//
// DirEntry flags