* security.cc (create_token): Call __sec_user() instead of

sec_user() to remove dependence on allow_ntsec. Verify that
	the returned sd is non-null.
This commit is contained in:
Corinna Vinschen 2002-05-24 14:44:05 +00:00
parent f1b53fa94c
commit 908f9b653b
2 changed files with 11 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2002-05-22 Pierre Humblet <pierre.humblet@ieee.org>
* security.cc (create_token): Call __sec_user() instead of
sec_user() to remove dependence on allow_ntsec. Verify that
the returned sd is non-null.
2002-05-25 Robert Collins <rbtcollins@hotmail.com>
* gmon.c (fake_sbrk): Correctly return -1 on failed malloc's.

View File

@ -854,10 +854,11 @@ create_token (cygsid &usersid, cygsid &pgrpsid)
else
{
/* Set security descriptor and primary group */
psa = sec_user (sa_buf, usersid);
if (!SetSecurityDescriptorGroup (
(PSECURITY_DESCRIPTOR) psa->lpSecurityDescriptor,
special_pgrp?pgrpsid:well_known_null_sid, FALSE))
psa = __sec_user (sa_buf, usersid, TRUE);
if (psa->lpSecurityDescriptor &&
!SetSecurityDescriptorGroup (
(PSECURITY_DESCRIPTOR) psa->lpSecurityDescriptor,
special_pgrp?pgrpsid:well_known_null_sid, FALSE))
debug_printf ("SetSecurityDescriptorGroup %E");
/* Convert to primary token. */
if (!DuplicateTokenEx (token, MAXIMUM_ALLOWED, psa,