* pinfo.cc (pinfo::init): Define sa_buf as PSECURITY_ATTRIBUTES and

allocate dynamically.
	(pinfo::set_acl): Replace sa_buf by dynamically allocated acl_buf.
	* sec_acl.cc (setacl): Allocate acl dynamically.
	* sec_helper.cc (sec_acl): Add test for alignment of acl when
	DEBUGGING is defined.
	(__sec_user): Same for sa_buf.
	* security.cc (verify_token): Define sd_buf as PSECURITY_DESCRIPTOR
	and allocate dynamically.
	(alloc_sd): Allocate acl dynamically.
	security.h (sec_user_nih): Change first parameter to
	SECURITY_ATTRIBUTES *.
	(sec_user): Ditto.
	* sigproc.cc (wait_sig): Define sa_buf as PSECURITY_ATTRIBUTES and
	allocate dynamically.
	* syscalls.cc (seteuid32): Define dacl_buf as PACL and allocate
	dynamically.
	* uinfo.cc (cygheap_user::init): Define sa_buf as PSECURITY_ATTRIBUTES
	and allocate dynamically.
	* winbase.h (ilockincr): Mark first argument of inline assembly as
	earlyclobber.
	(ilockdecr): Ditto.
This commit is contained in:
Corinna Vinschen
2005-06-07 19:31:42 +00:00
parent b739751db9
commit 7311cc1f0c
10 changed files with 57 additions and 23 deletions

View File

@@ -199,7 +199,7 @@ pinfo::init (pid_t n, DWORD flag, HANDLE h0)
}
procinfo = NULL;
char sa_buf[1024];
PSECURITY_ATTRIBUTES sa_buf = (PSECURITY_ATTRIBUTES) alloca (1024);
PSECURITY_ATTRIBUTES sec_attribs = sec_user_nih (sa_buf, cygheap->user.sid(),
well_known_world_sid,
FILE_MAP_READ);
@@ -307,14 +307,14 @@ pinfo::init (pid_t n, DWORD flag, HANDLE h0)
void
pinfo::set_acl()
{
char sa_buf[1024];
PACL acl_buf = (PACL) alloca (1024);
SECURITY_DESCRIPTOR sd;
sec_acl ((PACL) sa_buf, true, true, cygheap->user.sid (),
sec_acl (acl_buf, true, true, cygheap->user.sid (),
well_known_world_sid, FILE_MAP_READ);
if (!InitializeSecurityDescriptor (&sd, SECURITY_DESCRIPTOR_REVISION))
debug_printf ("InitializeSecurityDescriptor %E");
else if (!SetSecurityDescriptorDacl (&sd, TRUE, (PACL) sa_buf, FALSE))
else if (!SetSecurityDescriptorDacl (&sd, TRUE, acl_buf, FALSE))
debug_printf ("SetSecurityDescriptorDacl %E");
else if (!SetKernelObjectSecurity (h, DACL_SECURITY_INFORMATION, &sd))
debug_printf ("SetKernelObjectSecurity %E");