diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2011-04-28 09:53:11 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2011-04-28 09:53:11 +0000 |
commit | 1838d97b0a27fba6511ee718d527e93000231587 (patch) | |
tree | f4bb97e6b32970c5c8fb61bf6436c94b4a31dc80 /winsup/cygwin/sec_acl.cc | |
parent | 1754539e56dcde666394354ec603d5524b0d3e90 (diff) | |
download | newlib-1838d97b0a27fba6511ee718d527e93000231587.zip newlib-1838d97b0a27fba6511ee718d527e93000231587.tar.gz newlib-1838d97b0a27fba6511ee718d527e93000231587.tar.bz2 |
* advapi32.cc (GetSecurityDescriptorDacl): Remove.
(GetSecurityDescriptorGroup): Remove.
(GetSecurityDescriptorOwner): Remove.
* sec_acl.cc: Replace above functions throughout with their ntdll.dll
equivalent. Remove redundant debug output.
* sec_auth.cc: Ditto.
* security.cc: Ditto.
* uinfo.cc: Ditto.
Diffstat (limited to 'winsup/cygwin/sec_acl.cc')
-rw-r--r-- | winsup/cygwin/sec_acl.cc | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/winsup/cygwin/sec_acl.cc b/winsup/cygwin/sec_acl.cc index 48012e2..e7e79ad 100644 --- a/winsup/cygwin/sec_acl.cc +++ b/winsup/cygwin/sec_acl.cc @@ -47,22 +47,25 @@ setacl (HANDLE handle, path_conv &pc, int nentries, __aclent32_t *aclbufp, if (get_file_sd (handle, pc, sd_ret, false)) return -1; - BOOL dummy; + NTSTATUS status; + BOOLEAN dummy; /* Get owner SID. */ PSID owner_sid; - if (!GetSecurityDescriptorOwner (sd_ret, &owner_sid, &dummy)) + status = RtlGetOwnerSecurityDescriptor (sd_ret, &owner_sid, &dummy); + if (!NT_SUCCESS (status)) { - __seterrno (); + __seterrno_from_nt_status (status); return -1; } cygsid owner (owner_sid); /* Get group SID. */ PSID group_sid; - if (!GetSecurityDescriptorGroup (sd_ret, &group_sid, &dummy)) + status = RtlGetGroupSecurityDescriptor (sd_ret, &group_sid, &dummy); + if (!NT_SUCCESS (status)) { - __seterrno (); + __seterrno_from_nt_status (status); return -1; } cygsid group (group_sid); @@ -272,22 +275,23 @@ getacl (HANDLE handle, path_conv &pc, int nentries, __aclent32_t *aclbufp) cygpsid owner_sid; cygpsid group_sid; - BOOL dummy; + NTSTATUS status; + BOOLEAN dummy; __uid32_t uid; __gid32_t gid; - if (!GetSecurityDescriptorOwner (sd, (PSID *) &owner_sid, &dummy)) + status = RtlGetOwnerSecurityDescriptor (sd, (PSID *) &owner_sid, &dummy); + if (!NT_SUCCESS (status)) { - debug_printf ("GetSecurityDescriptorOwner %E"); - __seterrno (); + __seterrno_from_nt_status (status); return -1; } uid = owner_sid.get_uid (); - if (!GetSecurityDescriptorGroup (sd, (PSID *) &group_sid, &dummy)) + status = RtlGetGroupSecurityDescriptor (sd, (PSID *) &group_sid, &dummy); + if (!NT_SUCCESS (status)) { - debug_printf ("GetSecurityDescriptorGroup %E"); - __seterrno (); + __seterrno_from_nt_status (status); return -1; } gid = group_sid.get_gid (); @@ -305,12 +309,12 @@ getacl (HANDLE handle, path_conv &pc, int nentries, __aclent32_t *aclbufp) lacl[3].a_perm = S_IROTH | S_IWOTH | S_IXOTH; PACL acl; - BOOL acl_exists; + BOOLEAN acl_exists; - if (!GetSecurityDescriptorDacl (sd, &acl_exists, &acl, &dummy)) + status = RtlGetDaclSecurityDescriptor (sd, &acl_exists, &acl, &dummy); + if (!NT_SUCCESS (status)) { - __seterrno (); - debug_printf ("GetSecurityDescriptorDacl %E"); + __seterrno_from_nt_status (status); return -1; } |