* autoload.cc (SetUserObjectSecurity): Drop.

* pinfo.cc (pinfo::set_acl): Use NtSetSecurityObject instead of
	SetKernelObjectSecurity.
	* spawn.cc (spawn_guts): Use NtSetSecurityObject instead of
	SetUserObjectSecurity.
	* uinfo.cc (cygheap_user::init): Ditto.
This commit is contained in:
Corinna Vinschen
2007-07-19 08:36:32 +00:00
parent cce28460fe
commit 5f9c8e2a87
5 changed files with 24 additions and 7 deletions

View File

@ -30,6 +30,7 @@ details. */
#include "child_info.h"
#include "environ.h"
#include "pwdgrp.h"
#include "ntdll.h"
/* Initialize the part of cygheap_user that does not depend on files.
The information is used in shared.cc for the user shared.
@ -72,12 +73,15 @@ cygheap_user::init ()
if (GetSecurityDescriptorDacl (psd, &acl_exists, &dacl.DefaultDacl, &dummy)
&& acl_exists && dacl.DefaultDacl)
{
NTSTATUS status;
/* Set the default DACL and the process DACL */
if (!SetTokenInformation (hProcToken, TokenDefaultDacl, &dacl,
sizeof (dacl)))
system_printf ("SetTokenInformation (TokenDefaultDacl), %E");
if (!SetKernelObjectSecurity (hMainProc, DACL_SECURITY_INFORMATION, psd))
system_printf ("SetKernelObjectSecurity, %E");
if ((status = NtSetSecurityObject (hMainProc, DACL_SECURITY_INFORMATION,
psd)))
system_printf ("NtSetSecurityObject, %lx", status);
}
else
system_printf("Cannot get dacl, %E");