diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2011-04-29 10:38:12 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2011-04-29 10:38:12 +0000 |
commit | 5735d5f6f4cc65cb8afcbd7da83165b6e9cbc5d8 (patch) | |
tree | 8410d0cb5a9ea6b1cb226821d22cd5416e47e968 /winsup/cygwin/sec_auth.cc | |
parent | 3e8e0c33c00e384867d394c9a84a3d31f5208a61 (diff) | |
download | cygnal-5735d5f6f4cc65cb8afcbd7da83165b6e9cbc5d8.tar.gz cygnal-5735d5f6f4cc65cb8afcbd7da83165b6e9cbc5d8.tar.bz2 cygnal-5735d5f6f4cc65cb8afcbd7da83165b6e9cbc5d8.zip |
* advapi32.cc: Add comment.
(EqualSid): Remove.
(CopySid): Remove.
(AddAccessAllowedAce): Remove.
(AddAccessDeniedAce): Remove.
(MakeSelfRelativeSD): Remove.
* flock.cc: Replace above functions throughout with their ntdll.dll
equivalent.
* sec_acl.cc: Ditto.
* sec_auth.cc: Ditto.
* sec_helper.cc: Ditto.
* security.cc: Ditto.
* security.h: Ditto.
(RtlEqualSid): Declare. Explain why.
(RtlCopySid): Ditto.
Diffstat (limited to 'winsup/cygwin/sec_auth.cc')
-rw-r--r-- | winsup/cygwin/sec_auth.cc | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/winsup/cygwin/sec_auth.cc b/winsup/cygwin/sec_auth.cc index 575a1d3c1..78fa52767 100644 --- a/winsup/cygwin/sec_auth.cc +++ b/winsup/cygwin/sec_auth.cc @@ -1047,13 +1047,14 @@ lsaauth (cygsid &usersid, user_groups &new_groups, struct passwd *pw) dacl = (PACL) alloca (dsize); if (!NT_SUCCESS (RtlCreateAcl (dacl, dsize, ACL_REVISION))) goto out; - if (!AddAccessAllowedAce (dacl, ACL_REVISION, GENERIC_ALL, usersid)) + if (!NT_SUCCESS (RtlAddAccessAllowedAce (dacl, ACL_REVISION, GENERIC_ALL, + usersid))) goto out; - if (!AddAccessAllowedAce (dacl, ACL_REVISION, GENERIC_ALL, - well_known_admins_sid)) + if (!NT_SUCCESS (RtlAddAccessAllowedAce (dacl, ACL_REVISION, GENERIC_ALL, + well_known_admins_sid))) goto out; - if (!AddAccessAllowedAce (dacl, ACL_REVISION, GENERIC_ALL, - well_known_system_sid)) + if (!NT_SUCCESS (RtlAddAccessAllowedAce (dacl, ACL_REVISION, GENERIC_ALL, + well_known_system_sid))) goto out; /* Evaluate authinf size and allocate authinf. */ @@ -1096,8 +1097,8 @@ lsaauth (cygsid &usersid, user_groups &new_groups, struct passwd *pw) /* User SID */ authinf->inf.User.User.Sid = offset; authinf->inf.User.User.Attributes = 0; - CopySid (RtlLengthSid (usersid), (PSID) ((PBYTE) &authinf->inf + offset), - usersid); + RtlCopySid (RtlLengthSid (usersid), (PSID) ((PBYTE) &authinf->inf + offset), + usersid); offset += RtlLengthSid (usersid); /* Groups */ authinf->inf.Groups = offset; @@ -1119,16 +1120,16 @@ lsaauth (cygsid &usersid, user_groups &new_groups, struct passwd *pw) if (wincap.needs_logon_sid_in_sid_list () && tmp_gsids.sids[tmpidx] == fake_logon_sid) gsids->Groups[i].Attributes += SE_GROUP_LOGON_ID; - CopySid (RtlLengthSid (tmp_gsids.sids[tmpidx]), - (PSID) ((PBYTE) &authinf->inf + sids_offset), - tmp_gsids.sids[tmpidx]); + RtlCopySid (RtlLengthSid (tmp_gsids.sids[tmpidx]), + (PSID) ((PBYTE) &authinf->inf + sids_offset), + tmp_gsids.sids[tmpidx]); sids_offset += RtlLengthSid (tmp_gsids.sids[tmpidx]); } offset += gsize; /* Primary Group SID */ authinf->inf.PrimaryGroup.PrimaryGroup = offset; - CopySid (RtlLengthSid (pgrpsid), (PSID) ((PBYTE) &authinf->inf + offset), - pgrpsid); + RtlCopySid (RtlLengthSid (pgrpsid), (PSID) ((PBYTE) &authinf->inf + offset), + pgrpsid); offset += RtlLengthSid (pgrpsid); /* Privileges */ authinf->inf.Privileges = offset; |