mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 17:05:45 +00:00
Add support for setting a security descriptor for a file. Send an
IRP_MJ_SET_SECURITY to the filesystem driver and return STATUS_SUCCESS if the filesystem driver does not support this IRP. svn path=/trunk/; revision=10804
This commit is contained in:
parent
539582375e
commit
b451846efb
1 changed files with 39 additions and 8 deletions
|
@ -1,4 +1,4 @@
|
|||
/* $Id: iomgr.c,v 1.51 2004/09/07 11:51:13 ekohl Exp $
|
||||
/* $Id: iomgr.c,v 1.52 2004/09/08 11:42:56 ekohl Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -222,9 +222,40 @@ IopSecurityFile(PVOID ObjectBody,
|
|||
{
|
||||
case SetSecurityDescriptor:
|
||||
DPRINT("Set security descriptor\n");
|
||||
return STATUS_SUCCESS;
|
||||
KeResetEvent(&FileObject->Event);
|
||||
Irp = IoBuildSynchronousFsdRequest(IRP_MJ_SET_SECURITY,
|
||||
FileObject->DeviceObject,
|
||||
NULL,
|
||||
0,
|
||||
NULL,
|
||||
&FileObject->Event,
|
||||
&IoStatusBlock);
|
||||
|
||||
StackPtr = IoGetNextIrpStackLocation(Irp);
|
||||
StackPtr->FileObject = FileObject;
|
||||
|
||||
StackPtr->Parameters.SetSecurity.SecurityInformation = SecurityInformation;
|
||||
StackPtr->Parameters.SetSecurity.SecurityDescriptor = SecurityDescriptor;
|
||||
|
||||
Status = IoCallDriver(FileObject->DeviceObject, Irp);
|
||||
if (Status == STATUS_PENDING)
|
||||
{
|
||||
KeWaitForSingleObject(&FileObject->Event,
|
||||
Executive,
|
||||
KernelMode,
|
||||
FALSE,
|
||||
NULL);
|
||||
Status = IoStatusBlock.Status;
|
||||
}
|
||||
|
||||
if (Status == STATUS_INVALID_DEVICE_REQUEST)
|
||||
{
|
||||
Status = STATUS_SUCCESS;
|
||||
}
|
||||
return Status;
|
||||
|
||||
case QuerySecurityDescriptor:
|
||||
DPRINT("Query security descriptor\n");
|
||||
KeResetEvent(&FileObject->Event);
|
||||
Irp = IoBuildSynchronousFsdRequest(IRP_MJ_QUERY_SECURITY,
|
||||
FileObject->DeviceObject,
|
||||
|
@ -253,17 +284,17 @@ IopSecurityFile(PVOID ObjectBody,
|
|||
Status = IoStatusBlock.Status;
|
||||
}
|
||||
|
||||
if (Status == STATUS_BUFFER_TOO_SMALL)
|
||||
{
|
||||
/* FIXME: retrieve BufferLength */
|
||||
*BufferLength = 0;
|
||||
}
|
||||
else if (Status == STATUS_INVALID_DEVICE_REQUEST)
|
||||
if (Status == STATUS_INVALID_DEVICE_REQUEST)
|
||||
{
|
||||
Status = IopSetDefaultSecurityDescriptor(SecurityInformation,
|
||||
SecurityDescriptor,
|
||||
BufferLength);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* FIXME: Is this correct?? */
|
||||
*BufferLength = IoStatusBlock.Information;
|
||||
}
|
||||
return Status;
|
||||
|
||||
case DeleteSecurityDescriptor:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue