![]() | ![]() | ![]() | Ximian Connector for Microsoft Exchange Programmer’s Reference Manual | ![]() |
---|
E2kSid — Windows Security Identifiers
struct E2kSid; enum E2kSidType; E2kSid* e2k_sid_new_from_string_sid (E2kSidType type, constchar *string_sid, constchar *display_name); E2kSid* e2k_sid_new_from_binary_sid (E2kSidType type, constguint8 *binary_sid, constchar *display_name); #define E2K_SID_WKS_EVERYONE #define E2K_SID_WKS_ANONYMOUS E2kSidType e2k_sid_get_sid_type (E2kSid *sid); constchar * e2k_sid_get_string_sid (E2kSid *sid); constguint8 * e2k_sid_get_binary_sid (E2kSid *sid); constchar * e2k_sid_get_display_name (E2kSid *sid); #define E2K_SID_BINARY_SID_LEN (bsid)guint e2k_sid_binary_sid_hash (gconstpointer key);gint e2k_sid_binary_sid_equal (gconstpointer a,gconstpointer b);
GObject +----E2kSid
Every user in a Windows domain has a list of Security Identifiers, or SIDs, associated with them. This includes:
their own personal SID
the SID representing “all users in the local domain”
the SID representing “Default”
the SIDs for any Windows security groups that they are members of
The user’s personal SID is stored in the objectSid property of their Active Directory entry. Unfortunately, we have no way of retrieving the complete list of SIDs associated with a user.
struct E2kSid;
This corresponds to a Windows SID, as defined in WinNT.h:
typedef struct { BYTE Value[6]; // Big-Endian } SID_IDENTIFIER_AUTHORITY; typedef struct { BYTE Revision; BYTE SubAuthorityCount; SID_IDENTIFIER_AUTHORITY IdentifierAuthority; DWORD SubAuthority[ANYSIZE_ARRAY]; } SID; #define SID_REVISION (1) // Current revision level
SIDs are also sometimes expressed in string form as:
"S-Revision-IdentifierAuthority-SubAuthority[0]-SubAuthority[1]-..."
typedef enum { E2K_SID_TYPE_INVALID, E2K_SID_TYPE_USER, E2K_SID_TYPE_ALIAS, E2K_SID_TYPE_GROUP, E2K_SID_TYPE_WELL_KNOWN_GROUP, E2K_SID_TYPE_DOMAIN, E2K_SID_TYPE_DELETED_ACCOUNT, E2K_SID_TYPE_UNKNOWN, E2K_SID_TYPE_COMPUTER } E2kSidType;
This indicates what kind of object the SID refers to. Connector only uses the values E2K_SID_TYPE_USER, E2K_SID_TYPE_GROUP, and E2K_SID_TYPE_WELL_KNOWN_GROUP (for things like “Default”)
E2kSid* e2k_sid_new_from_string_sid (E2kSidType type, constchar *string_sid, constchar *display_name);
Creates an E2kSid from the given information
type : | the type of SID that string_sid is |
string_sid : | the string form of a Windows Security Identifier |
display_name : | UTF-8 display name of the user/group/etc identified by string_sid |
Returns : | the new SID |
E2kSid* e2k_sid_new_from_binary_sid (E2kSidType type, constguint8 *binary_sid, constchar *display_name);
Creates an E2kSid from the given information
type : | the type of SID that binary_sid is |
binary_sid : | the binary form of a Windows Security Identifier |
display_name : | UTF-8 display name of the user/group/etc identified by string_sid |
Returns : | the new SID |
#define E2K_SID_WKS_EVERYONE "S-1-1-0"
This can be passed as the string_sid to e2k_sid_new_from_string_sid() to create a SID representing default access. You can pass NULL for the display_name.
#define E2K_SID_WKS_ANONYMOUS "S-1-5-7"
This can be passed as the string_sid to e2k_sid_new_from_string_sid() to create a SID representing anonymous access. You can pass NULL for the display_name.
E2kSidType e2k_sid_get_sid_type (E2kSid *sid);
Returns the type of sid (user, group, etc)
sid : | a SID |
Returns : | the E2kSidType |
constchar * e2k_sid_get_string_sid (E2kSid *sid);
Returns the string form of sid
sid : | a SID |
Returns : | the string SID |
constguint8 * e2k_sid_get_binary_sid (E2kSid *sid);
Returns the binary form of sid. Since the SID data is self-delimiting, no length value is needed. Use E2K_SID_BINARY_SID_LEN() if you need to know the size of the binary data.
sid : | a SID |
Returns : | the binary SID |
constchar * e2k_sid_get_display_name (E2kSid *sid);
Returns the display name of the entity identified by sid
sid : | a SID |
Returns : | the UTF-8 display name |
#define E2K_SID_BINARY_SID_LEN(bsid) (8 + ((guint8 *)bsid)[1] * 4)
Returns the length of bsid
bsid : | the binary form of a SID |
Returns : | the length of bsid |
guint e2k_sid_binary_sid_hash (gconstpointer key);
Hashes key, a binary SID. For use with
key : | pointer to a binary SID |
Returns : | the hash value |
e2k_global_catalog_lookup(), E2kSecurityDescriptor
<< e2k-http-utils | E2kSecurityDescriptor >> |