From 6806a8b51f96d59cb6dadd86fab4ae7cdecca3ed Mon Sep 17 00:00:00 2001 From: Pierre Humblet Date: Sat, 27 Sep 2003 01:56:36 +0000 Subject: 2003-09-26 Pierre Humblet * uinfo.cc (cygheap_user::init): Make sure the current user appears in the default DACL. Rearrange to decrease the indentation levels. Initialize the effec_cygsid directly. (internal_getlogin): Do not reinitialize myself->gid. Open the process token with the required access. * cygheap.h (class cygheap_user): Delete members pid and saved_psid. Create members effec_cygsid and saved_cygsid. (cygheap_user::set_sid): Define inline. (cygheap_user::set_saved_sid): Ditto. (cygheap_user::sid): Modify. (cygheap_user::saved_sid): Modify. * cygheap.cc (cygheap_user::set_sid): Delete. (cygheap_user::set_saved_sid): Ditto. * sec_helper.cc (sec_acl): Set the correct acl size. * autoload.cc (FindFirstFreeAce): Add. * security.h: Define ACL_DEFAULT_SIZE. --- winsup/cygwin/sec_helper.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'winsup/cygwin/sec_helper.cc') diff --git a/winsup/cygwin/sec_helper.cc b/winsup/cygwin/sec_helper.cc index 040760685..dda352543 100644 --- a/winsup/cygwin/sec_helper.cc +++ b/winsup/cygwin/sec_helper.cc @@ -375,6 +375,7 @@ BOOL sec_acl (PACL acl, bool original, bool admins, PSID sid1, PSID sid2, DWORD access2) { size_t acl_len = MAX_DACL_LEN(5); + LPVOID pAce; cygpsid psid; if (!InitializeAcl (acl, acl_len, ACL_REVISION)) @@ -402,6 +403,12 @@ sec_acl (PACL acl, bool original, bool admins, PSID sid1, PSID sid2, DWORD acces if (!AddAccessAllowedAce (acl, ACL_REVISION, GENERIC_ALL, well_known_system_sid)) debug_printf ("AddAccessAllowedAce(system) %E"); + FindFirstFreeAce (acl, &pAce); + if (pAce) + acl->AclSize = (char *) pAce - (char *) acl; + else + debug_printf ("FindFirstFreeAce %E"); + return TRUE; } -- cgit v1.2.3