* 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.
This commit is contained in:
@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user