Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2006-12-20 20:14:23 +0300
committerCorinna Vinschen <corinna@vinschen.de>2006-12-20 20:14:23 +0300
commit97b09fe1c55dc843fc0bb8a87491aed8b620f63d (patch)
treee362202203bf70b6297f5eb2f8e5165365e8cd0c /winsup/cygwin/security.h
parent24fa638dbd330c35b1063ad0e9f155a869c3ce17 (diff)
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/security.h')
-rw-r--r--winsup/cygwin/security.h11
1 files changed, 3 insertions, 8 deletions
diff --git a/winsup/cygwin/security.h b/winsup/cygwin/security.h
index cab33be8b..08bcc2f09 100644
--- a/winsup/cygwin/security.h
+++ b/winsup/cygwin/security.h
@@ -216,21 +216,16 @@ class security_descriptor {
protected:
PSECURITY_DESCRIPTOR psd;
DWORD sd_size;
- enum { local_alloced, malloced } type;
public:
- security_descriptor () : psd (NULL), sd_size (0), type (local_alloced) {}
+ security_descriptor () : psd (NULL), sd_size (0) {}
~security_descriptor () { free (); }
PSECURITY_DESCRIPTOR malloc (size_t nsize);
PSECURITY_DESCRIPTOR realloc (size_t nsize);
void free ();
- inline DWORD size () {
- if (!sd_size && psd && type == local_alloced)
- sd_size = LocalSize (psd);
- return sd_size;
- }
- inline DWORD copy (void *buf, DWORD buf_size) {
+ inline DWORD size () const { return sd_size; }
+ inline DWORD copy (void *buf, DWORD buf_size) const {
if (buf_size < size ())
return sd_size;
memcpy (buf, psd, sd_size);