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>2004-02-05 20:23:19 +0300
committerCorinna Vinschen <corinna@vinschen.de>2004-02-05 20:23:19 +0300
commitd82c6f474d1126cdd7d298991610fa23823dd99f (patch)
tree617e6fefbae53c368edbdcb131571c50e5e7877e /winsup/cygwin/sec_helper.cc
parent0d902e61d123e5c3b04a6892b7dfccb82e2a7111 (diff)
* security.h (SID): New macro.
(well_known_*_sid): Change type to cygpsid. (cygsid::init): Delete declaration. * sec_helper.cc (well_known_*_sid): Define using above SID macro. (cygsid::init): Delete. * dcrt0.cc (dll_crt0_0): Do not call cygsid::init. * security.cc (get_user_local_groups): Change the second argument type to cygpsid.
Diffstat (limited to 'winsup/cygwin/sec_helper.cc')
-rw-r--r--winsup/cygwin/sec_helper.cc58
1 files changed, 27 insertions, 31 deletions
diff --git a/winsup/cygwin/sec_helper.cc b/winsup/cygwin/sec_helper.cc
index 9683a5aa4..7888c161e 100644
--- a/winsup/cygwin/sec_helper.cc
+++ b/winsup/cygwin/sec_helper.cc
@@ -47,19 +47,33 @@ SID_IDENTIFIER_AUTHORITY NO_COPY sid_auth[] = {
{SECURITY_NT_AUTHORITY}
};
-cygsid well_known_null_sid;
-cygsid well_known_world_sid;
-cygsid well_known_local_sid;
-cygsid well_known_creator_owner_sid;
-cygsid well_known_creator_group_sid;
-cygsid well_known_dialup_sid;
-cygsid well_known_network_sid;
-cygsid well_known_batch_sid;
-cygsid well_known_interactive_sid;
-cygsid well_known_service_sid;
-cygsid well_known_authenticated_users_sid;
-cygsid well_known_system_sid;
-cygsid well_known_admins_sid;
+SID (well_known_null_sid, "S-1-0-0",
+ SECURITY_NULL_SID_AUTHORITY, 1, SECURITY_NULL_RID);
+SID (well_known_world_sid, "S-1-1-0",
+ SECURITY_WORLD_SID_AUTHORITY, 1, SECURITY_WORLD_RID);
+SID (well_known_local_sid, "S-1-2-0",
+ SECURITY_LOCAL_SID_AUTHORITY, 1, SECURITY_LOCAL_RID);
+SID (well_known_creator_owner_sid, "S-1-3-0",
+ SECURITY_CREATOR_SID_AUTHORITY, 1, SECURITY_CREATOR_OWNER_RID);
+SID (well_known_creator_group_sid, "S-1-3-1",
+ SECURITY_CREATOR_SID_AUTHORITY, 1, SECURITY_CREATOR_GROUP_RID);
+SID (well_known_dialup_sid, "S-1-5-1",
+ SECURITY_NT_AUTHORITY, 1, SECURITY_DIALUP_RID);
+SID (well_known_network_sid, "S-1-5-2",
+ SECURITY_NT_AUTHORITY, 1, SECURITY_NETWORK_RID);
+SID (well_known_batch_sid, "S-1-5-3",
+ SECURITY_NT_AUTHORITY, 1, SECURITY_BATCH_RID);
+SID (well_known_interactive_sid, "S-1-5-4",
+ SECURITY_NT_AUTHORITY, 1, SECURITY_INTERACTIVE_RID);
+SID (well_known_service_sid, "S-1-5-6",
+ SECURITY_NT_AUTHORITY, 1, SECURITY_SERVICE_RID);
+SID (well_known_authenticated_users_sid, "S-1-5-11",
+ SECURITY_NT_AUTHORITY, 1, SECURITY_AUTHENTICATED_USER_RID);
+SID (well_known_system_sid, "S-1-5-18",
+ SECURITY_NT_AUTHORITY, 1, SECURITY_LOCAL_SYSTEM_RID);
+SID (well_known_admins_sid, "S-1-5-32-544",
+ SECURITY_NT_AUTHORITY, 2, SECURITY_BUILTIN_DOMAIN_RID,
+ DOMAIN_ALIAS_RID_ADMINS);
bool
cygpsid::operator== (const char *nsidstr) const
@@ -118,24 +132,6 @@ cygpsid::string (char *nsidstr) const
return nsidstr;
}
-void
-cygsid::init ()
-{
- well_known_null_sid = "S-1-0-0";
- well_known_world_sid = "S-1-1-0";
- well_known_local_sid = "S-1-2-0";
- well_known_creator_owner_sid = "S-1-3-0";
- well_known_creator_group_sid = "S-1-3-1";
- well_known_dialup_sid = "S-1-5-1";
- well_known_network_sid = "S-1-5-2";
- well_known_batch_sid = "S-1-5-3";
- well_known_interactive_sid = "S-1-5-4";
- well_known_service_sid = "S-1-5-6";
- well_known_authenticated_users_sid = "S-1-5-11";
- well_known_system_sid = "S-1-5-18";
- well_known_admins_sid = "S-1-5-32-544";
-}
-
PSID
cygsid::get_sid (DWORD s, DWORD cnt, DWORD *r)
{