diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2006-12-20 17:14:23 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2006-12-20 17:14:23 +0000 |
commit | 97b09fe1c55dc843fc0bb8a87491aed8b620f63d (patch) | |
tree | e362202203bf70b6297f5eb2f8e5165365e8cd0c /winsup/cygwin/sec_helper.cc | |
parent | 24fa638dbd330c35b1063ad0e9f155a869c3ce17 (diff) | |
download | cygnal-97b09fe1c55dc843fc0bb8a87491aed8b620f63d.tar.gz cygnal-97b09fe1c55dc843fc0bb8a87491aed8b620f63d.tar.bz2 cygnal-97b09fe1c55dc843fc0bb8a87491aed8b620f63d.zip |
Partially revert change from 2006-10-22. GetSecurityInfo messes up
user information on NT4.
* sec_helper.cc (security_descriptor::malloc): Drop LocalAlloc
considerations.
(security_descriptor::realloc): Ditto.
(security_descriptor::free): Ditto.
* security.cc (get_reg_security): Reinstantiate.
(get_nt_object_security): Revert to using NtQuerySecurityObject.
* security.h (class security_descriptor): Drop type member.
Accommodate throughout.
(security_descriptor::size): Constify.
(security_descriptor::copy): Ditto.
Diffstat (limited to 'winsup/cygwin/sec_helper.cc')
-rw-r--r-- | winsup/cygwin/sec_helper.cc | 31 |
1 files changed, 4 insertions, 27 deletions
diff --git a/winsup/cygwin/sec_helper.cc b/winsup/cygwin/sec_helper.cc index 41a9b16d6..7f71c8474 100644 --- a/winsup/cygwin/sec_helper.cc +++ b/winsup/cygwin/sec_helper.cc @@ -266,10 +266,7 @@ security_descriptor::malloc (size_t nsize) { free (); if ((psd = (PSECURITY_DESCRIPTOR) ::malloc (nsize))) - { - sd_size = nsize; - type = malloced; - } + sd_size = nsize; return psd; } @@ -278,23 +275,9 @@ security_descriptor::realloc (size_t nsize) { PSECURITY_DESCRIPTOR tmp; - if (type == malloced) - { - if (!(tmp = (PSECURITY_DESCRIPTOR) ::realloc (psd, nsize))) - return NULL; - } - else - { - if (!(tmp = (PSECURITY_DESCRIPTOR) ::malloc (nsize))) - return NULL; - if (psd) - { - memcpy (tmp, psd, LocalSize (psd)); - LocalFree (psd); - } - } + if (!(tmp = (PSECURITY_DESCRIPTOR) ::realloc (psd, nsize))) + return NULL; sd_size = nsize; - type = malloced; return psd = tmp; } @@ -302,15 +285,9 @@ void security_descriptor::free () { if (psd) - { - if (type == local_alloced) - LocalFree (psd); - else - ::free (psd); - } + ::free (psd); psd = NULL; sd_size = 0; - type = local_alloced; } #if 0 // unused |