Author: tfaber
Date: Mon Oct 20 08:08:50 2014
New Revision: 64839
URL:
http://svn.reactos.org/svn/reactos?rev=64839&view=rev
Log:
[NPFS]
- Correctly interpret SeCreateClientSecurity return value in NpInitializeSecurity
- Always charge quota when allocating client context
- Specify explicit 0 tag when freeing allocations with unknown pool tag
- Misc readability fixes
Modified:
trunk/reactos/drivers/filesystems/npfs/create.c
trunk/reactos/drivers/filesystems/npfs/secursup.c
trunk/reactos/drivers/filesystems/npfs/seinfo.c
Modified: trunk/reactos/drivers/filesystems/npfs/create.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs/c…
==============================================================================
--- trunk/reactos/drivers/filesystems/npfs/create.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/npfs/create.c [iso-8859-1] Mon Oct 20 08:08:50 2014
@@ -736,12 +736,12 @@
}
SecurityContext = &AccessState->SubjectSecurityContext;
- SeLockSubjectContext(&AccessState->SubjectSecurityContext);
-
- Status = SeAssignSecurity(0,
+ SeLockSubjectContext(SecurityContext);
+
+ Status = SeAssignSecurity(NULL,
AccessState->SecurityDescriptor,
&SecurityDescriptor,
- 0,
+ FALSE,
SecurityContext,
IoGetFileObjectGenericMapping(),
PagedPool);
@@ -756,7 +756,7 @@
Status = ObLogSecurityDescriptor(SecurityDescriptor,
&CachedSecurityDescriptor,
1);
- ExFreePool(SecurityDescriptor);
+ ExFreePoolWithTag(SecurityDescriptor, 0);
if (!NT_SUCCESS(Status))
{
Modified: trunk/reactos/drivers/filesystems/npfs/secursup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs/s…
==============================================================================
--- trunk/reactos/drivers/filesystems/npfs/secursup.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/npfs/secursup.c [iso-8859-1] Mon Oct 20 08:08:50
2014
@@ -108,15 +108,19 @@
return Status;
}
- ClientContext = ExAllocatePoolWithTag(PagedPool, sizeof(*ClientContext),
NPFS_CLIENT_SEC_CTX_TAG);
+ ClientContext = ExAllocatePoolWithQuotaTag(PagedPool |
POOL_QUOTA_FAIL_INSTEAD_OF_RAISE,
+ sizeof(*ClientContext),
+ NPFS_CLIENT_SEC_CTX_TAG);
Ccb->ClientContext = ClientContext;
if (!ClientContext) return STATUS_INSUFFICIENT_RESOURCES;
Status = SeCreateClientSecurity(Thread, &Ccb->ClientQos, 0, ClientContext);
- if (!NT_SUCCESS(Status)) return Status;
+ if (!NT_SUCCESS(Status))
+ {
+ ExFreePool(Ccb->ClientContext);
+ Ccb->ClientContext = NULL;
+ }
- ExFreePool(Ccb->ClientContext);
- Ccb->ClientContext = NULL;
return Status;
}
Modified: trunk/reactos/drivers/filesystems/npfs/seinfo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs/s…
==============================================================================
--- trunk/reactos/drivers/filesystems/npfs/seinfo.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/npfs/seinfo.c [iso-8859-1] Mon Oct 20 08:08:50 2014
@@ -85,7 +85,8 @@
if (!NT_SUCCESS(Status)) return Status;
Status = ObLogSecurityDescriptor(TempSecurityDescriptor, &NewSecurityDescriptor,
1);
- ExFreePool(TempSecurityDescriptor);
+ ASSERT(TempSecurityDescriptor != OldSecurityDescriptor);
+ ExFreePoolWithTag(TempSecurityDescriptor, 0);
if (!NT_SUCCESS(Status)) return Status;