mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-22 08:23:05 -05:00
sys: FileNode: properly maintain Security/SecurityChangeNumber fields
This commit is contained in:
parent
e77a8b0262
commit
9e057b4ea1
@ -105,8 +105,13 @@ VOID FspFileNodeDelete(FSP_FILE_NODE *FileNode)
|
|||||||
{
|
{
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
|
FSP_FSVOL_DEVICE_EXTENSION *FsvolDeviceExtension =
|
||||||
|
FspFsvolDeviceExtension(FileNode->FsvolDeviceObject);
|
||||||
|
|
||||||
FsRtlTeardownPerStreamContexts(&FileNode->Header);
|
FsRtlTeardownPerStreamContexts(&FileNode->Header);
|
||||||
|
|
||||||
|
FspMetaCacheInvalidateItem(FsvolDeviceExtension->SecurityCache, FileNode->Security);
|
||||||
|
|
||||||
FspDeviceDereference(FileNode->FsvolDeviceObject);
|
FspDeviceDereference(FileNode->FsvolDeviceObject);
|
||||||
|
|
||||||
if (0 != FileNode->ExternalFileName)
|
if (0 != FileNode->ExternalFileName)
|
||||||
@ -499,6 +504,7 @@ VOID FspFileNodeSetSecurity(FSP_FILE_NODE *FileNode, PCVOID Buffer, ULONG Size)
|
|||||||
FspMetaCacheInvalidateItem(FsvolDeviceExtension->SecurityCache, FileNode->Security);
|
FspMetaCacheInvalidateItem(FsvolDeviceExtension->SecurityCache, FileNode->Security);
|
||||||
FileNode->Security = 0 != Buffer ?
|
FileNode->Security = 0 != Buffer ?
|
||||||
FspMetaCacheAddItem(FsvolDeviceExtension->SecurityCache, Buffer, Size) : 0;
|
FspMetaCacheAddItem(FsvolDeviceExtension->SecurityCache, Buffer, Size) : 0;
|
||||||
|
FileNode->SecurityChangeNumber++;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN FspFileNodeTrySetSecurity(FSP_FILE_NODE *FileNode, PCVOID Buffer, ULONG Size,
|
BOOLEAN FspFileNodeTrySetSecurity(FSP_FILE_NODE *FileNode, PCVOID Buffer, ULONG Size,
|
||||||
|
@ -292,7 +292,7 @@ NTSTATUS FspFsvolSetSecurityComplete(
|
|||||||
/* if the security descriptor that we got back is valid */
|
/* if the security descriptor that we got back is valid */
|
||||||
if (0 < Response->Rsp.SetSecurity.SecurityDescriptor.Size &&
|
if (0 < Response->Rsp.SetSecurity.SecurityDescriptor.Size &&
|
||||||
Response->Buffer + Response->Rsp.SetSecurity.SecurityDescriptor.Size <=
|
Response->Buffer + Response->Rsp.SetSecurity.SecurityDescriptor.Size <=
|
||||||
(PUINT8)Response + Response->Size &&
|
(PUINT8)Response + Response->Size &&
|
||||||
RtlValidRelativeSecurityDescriptor((PVOID)Response->Buffer,
|
RtlValidRelativeSecurityDescriptor((PVOID)Response->Buffer,
|
||||||
Response->Rsp.SetSecurity.SecurityDescriptor.Size, 0))
|
Response->Rsp.SetSecurity.SecurityDescriptor.Size, 0))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user