diff options
author | Pierre Humblet <phumblet@phumblet.no-ip.org> | 2003-09-27 01:56:36 +0000 |
---|---|---|
committer | Pierre Humblet <phumblet@phumblet.no-ip.org> | 2003-09-27 01:56:36 +0000 |
commit | 6806a8b51f96d59cb6dadd86fab4ae7cdecca3ed (patch) | |
tree | 513357f0c179f944228ac5f669f9e53b3456cce1 /winsup/cygwin/sec_helper.cc | |
parent | 349a6402fe566a06f18ee2a1e2d412b8b8d9d304 (diff) | |
download | cygnal-6806a8b51f96d59cb6dadd86fab4ae7cdecca3ed.tar.gz cygnal-6806a8b51f96d59cb6dadd86fab4ae7cdecca3ed.tar.bz2 cygnal-6806a8b51f96d59cb6dadd86fab4ae7cdecca3ed.zip |
2003-09-26 Pierre Humblet <pierre.humblet@ieee.org>
* 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.
Diffstat (limited to 'winsup/cygwin/sec_helper.cc')
-rw-r--r-- | winsup/cygwin/sec_helper.cc | 7 |
1 files changed, 7 insertions, 0 deletions
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; } |