mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 23:03:00 +00:00
[SAMSRV]
Start implementing SamrDeleteAlias and SamrDeleteUser. WIP svn path=/trunk/; revision=58220
This commit is contained in:
parent
1cb3985a69
commit
085adf3da0
1 changed files with 74 additions and 4 deletions
|
@ -4553,8 +4553,41 @@ NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
SamrDeleteAlias(IN OUT SAMPR_HANDLE *AliasHandle)
|
SamrDeleteAlias(IN OUT SAMPR_HANDLE *AliasHandle)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
PSAM_DB_OBJECT AliasObject;
|
||||||
return STATUS_NOT_IMPLEMENTED;
|
NTSTATUS Status;
|
||||||
|
|
||||||
|
/* Validate the alias handle */
|
||||||
|
Status = SampValidateDbObject(AliasHandle,
|
||||||
|
SamDbAliasObject,
|
||||||
|
DELETE,
|
||||||
|
&AliasObject);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
TRACE("failed with status 0x%08lx\n", Status);
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Fail, if the alias is built-in */
|
||||||
|
if (AliasObject->RelativeId < 1000)
|
||||||
|
{
|
||||||
|
TRACE("You can not delete a special account!\n");
|
||||||
|
return STATUS_SPECIAL_ACCOUNT;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* FIXME: Remove all members from the alias */
|
||||||
|
|
||||||
|
/* Delete the alias from the database */
|
||||||
|
Status = SampDeleteAccountDbObject(AliasObject);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
TRACE("SampDeleteAccountDbObject() failed (Status 0x%08lx)\n", Status);
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Invalidate the handle */
|
||||||
|
*AliasHandle = NULL;
|
||||||
|
|
||||||
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -4963,8 +4996,45 @@ NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
SamrDeleteUser(IN OUT SAMPR_HANDLE *UserHandle)
|
SamrDeleteUser(IN OUT SAMPR_HANDLE *UserHandle)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
PSAM_DB_OBJECT UserObject;
|
||||||
return STATUS_NOT_IMPLEMENTED;
|
NTSTATUS Status;
|
||||||
|
|
||||||
|
TRACE("(%p)\n", UserHandle);
|
||||||
|
|
||||||
|
/* Validate the user handle */
|
||||||
|
Status = SampValidateDbObject(*UserHandle,
|
||||||
|
SamDbUserObject,
|
||||||
|
DELETE,
|
||||||
|
&UserObject);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
TRACE("SampValidateDbObject() failed (Status 0x%08lx)\n", Status);
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Fail, if the user is built-in */
|
||||||
|
if (UserObject->RelativeId < 1000)
|
||||||
|
{
|
||||||
|
TRACE("You can not delete a special account!\n");
|
||||||
|
return STATUS_SPECIAL_ACCOUNT;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* FIXME: Remove the user from all groups */
|
||||||
|
|
||||||
|
/* FIXME: Remove the user from all aliases */
|
||||||
|
|
||||||
|
/* Delete the user from the database */
|
||||||
|
Status = SampDeleteAccountDbObject(UserObject);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
TRACE("SampDeleteAccountDbObject() failed (Status 0x%08lx)\n", Status);
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Invalidate the handle */
|
||||||
|
*UserHandle = NULL;
|
||||||
|
|
||||||
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue