diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2005-06-07 19:31:42 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2005-06-07 19:31:42 +0000 |
commit | 7311cc1f0c7f6f2ee26240c88698d61ed4749853 (patch) | |
tree | d13b088ae2c6fc1f9a260de6765d0fb0b4c9226d /winsup/cygwin/security.cc | |
parent | b739751db982170d8e10caa720e5c6a5a1918f37 (diff) | |
download | cygnal-7311cc1f0c7f6f2ee26240c88698d61ed4749853.tar.gz cygnal-7311cc1f0c7f6f2ee26240c88698d61ed4749853.tar.bz2 cygnal-7311cc1f0c7f6f2ee26240c88698d61ed4749853.zip |
* 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.
Diffstat (limited to 'winsup/cygwin/security.cc')
-rw-r--r-- | winsup/cygwin/security.cc | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc index 5d7930c38..aa961c90c 100644 --- a/winsup/cygwin/security.cc +++ b/winsup/cygwin/security.cc @@ -772,14 +772,14 @@ verify_token (HANDLE token, cygsid &usersid, user_groups &groups, bool *pintern) is not well_known_null_sid, it must match pgrpsid */ if (intern && !groups.issetgroups ()) { - char sd_buf[MAX_SID_LEN + sizeof (SECURITY_DESCRIPTOR)]; + const DWORD sd_buf_siz = MAX_SID_LEN + sizeof (SECURITY_DESCRIPTOR); + PSECURITY_DESCRIPTOR sd_buf = (PSECURITY_DESCRIPTOR) alloca (sd_buf_siz); cygpsid gsid (NO_SID); if (!GetKernelObjectSecurity (token, GROUP_SECURITY_INFORMATION, - (PSECURITY_DESCRIPTOR) sd_buf, - sizeof sd_buf, &size)) + sd_buf, sd_buf_siz, &size)) debug_printf ("GetKernelObjectSecurity(), %E"); - else if (!GetSecurityDescriptorGroup ((PSECURITY_DESCRIPTOR) sd_buf, - (PSID *) &gsid, (BOOL *) &size)) + else if (!GetSecurityDescriptorGroup (sd_buf, (PSID *) &gsid, + (BOOL *) &size)) debug_printf ("GetSecurityDescriptorGroup(), %E"); if (well_known_null_sid != gsid) return gsid == groups.pgsid; @@ -1538,8 +1538,7 @@ alloc_sd (__uid32_t uid, __gid32_t gid, int attribute, } /* Initialize local access control list. */ - char acl_buf[3072]; - PACL acl = (PACL) acl_buf; + PACL acl = (PACL) alloca (3072); if (!InitializeAcl (acl, 3072, ACL_REVISION)) { __seterrno (); |