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>2011-04-29 14:38:12 +0400
committerCorinna Vinschen <corinna@vinschen.de>2011-04-29 14:38:12 +0400
commit5735d5f6f4cc65cb8afcbd7da83165b6e9cbc5d8 (patch)
tree8410d0cb5a9ea6b1cb226821d22cd5416e47e968 /winsup/cygwin/security.h
parent3e8e0c33c00e384867d394c9a84a3d31f5208a61 (diff)
* 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/security.h')
-rw-r--r--winsup/cygwin/security.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/winsup/cygwin/security.h b/winsup/cygwin/security.h
index 6bc2a47dd..0a71221e2 100644
--- a/winsup/cygwin/security.h
+++ b/winsup/cygwin/security.h
@@ -95,6 +95,18 @@ cygpsid NO_COPY name = (PSID) &name##_struct;
#define FILE_WRITE_BITS (FILE_WRITE_DATA | GENERIC_WRITE | GENERIC_ALL)
#define FILE_EXEC_BITS (FILE_EXECUTE | GENERIC_EXECUTE | GENERIC_ALL)
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+ /* We need these declarations, otherwise g++ complains that the below
+ inline methods use an undefined function, if ntdll.h isn't included. */
+ BOOLEAN NTAPI RtlEqualSid (PSID, PSID);
+ NTSTATUS NTAPI RtlCopySid (ULONG, PSID, PSID);
+#ifdef __cplusplus
+}
+#endif
+
class cygpsid {
protected:
PSID psid;
@@ -114,7 +126,7 @@ public:
{
if (!psid || !nsid)
return nsid == psid;
- return EqualSid (psid, nsid);
+ return RtlEqualSid (psid, nsid);
}
bool operator!= (const PSID nsid) const
{ return !(*this == nsid); }
@@ -143,7 +155,7 @@ class cygsid : public cygpsid {
else
{
psid = (PSID) sbuf;
- CopySid (MAX_SID_LEN, psid, nsid);
+ RtlCopySid (MAX_SID_LEN, psid, nsid);
well_known_sid = well_known;
}
return psid;