diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2004-02-05 20:23:19 +0300 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2004-02-05 20:23:19 +0300 |
commit | d82c6f474d1126cdd7d298991610fa23823dd99f (patch) | |
tree | 617e6fefbae53c368edbdcb131571c50e5e7877e /winsup/cygwin/security.h | |
parent | 0d902e61d123e5c3b04a6892b7dfccb82e2a7111 (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/security.h')
-rw-r--r-- | winsup/cygwin/security.h | 37 |
1 files changed, 23 insertions, 14 deletions
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) |