From d82c6f474d1126cdd7d298991610fa23823dd99f Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 5 Feb 2004 17:23:19 +0000 Subject: * 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. --- winsup/cygwin/security.h | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) (limited to 'winsup/cygwin/security.h') diff --git a/winsup/cygwin/security.h b/winsup/cygwin/security.h index 8e958ba00..ac1a66461 100644 --- a/winsup/cygwin/security.h +++ b/winsup/cygwin/security.h @@ -23,6 +23,16 @@ details. */ #define ACL_DEFAULT_SIZE 3072 #define NO_SID ((PSID)NULL) +/* Macro to define variable length SID structures */ +#define SID(name, comment, authority, count, rid...) \ +static NO_COPY struct { \ + BYTE Revision; \ + BYTE SubAuthorityCount; \ + SID_IDENTIFIER_AUTHORITY IdentifierAuthority; \ + DWORD SubAuthority[count]; \ +} name##_struct = { SID_REVISION, count, {authority}, {rid}}; \ +cygpsid NO_COPY name = (PSID) &name##_struct; + #define FILE_READ_BITS (FILE_READ_DATA | GENERIC_READ | GENERIC_ALL) #define FILE_WRITE_BITS (FILE_WRITE_DATA | GENERIC_WRITE | GENERIC_ALL) #define FILE_EXEC_BITS (FILE_EXECUTE | GENERIC_EXECUTE | GENERIC_ALL) @@ -79,7 +89,6 @@ class cygsid : public cygpsid { } public: - static void init(); inline operator const PSID () { return psid; } inline const PSID operator= (cygsid &nsid) @@ -213,19 +222,19 @@ public: } }; -extern cygsid well_known_null_sid; -extern cygsid well_known_world_sid; -extern cygsid well_known_local_sid; -extern cygsid well_known_creator_owner_sid; -extern cygsid well_known_creator_group_sid; -extern cygsid well_known_dialup_sid; -extern cygsid well_known_network_sid; -extern cygsid well_known_batch_sid; -extern cygsid well_known_interactive_sid; -extern cygsid well_known_service_sid; -extern cygsid well_known_authenticated_users_sid; -extern cygsid well_known_system_sid; -extern cygsid well_known_admins_sid; +extern cygpsid well_known_null_sid; +extern cygpsid well_known_world_sid; +extern cygpsid well_known_local_sid; +extern cygpsid well_known_creator_owner_sid; +extern cygpsid well_known_creator_group_sid; +extern cygpsid well_known_dialup_sid; +extern cygpsid well_known_network_sid; +extern cygpsid well_known_batch_sid; +extern cygpsid well_known_interactive_sid; +extern cygpsid well_known_service_sid; +extern cygpsid well_known_authenticated_users_sid; +extern cygpsid well_known_system_sid; +extern cygpsid well_known_admins_sid; inline BOOL legal_sid_type (SID_NAME_USE type) -- cgit v1.2.3