Search by sid
**************************************************************************/
-static NTSTATUS testsam_getsampwsid (struct pdb_methods *methods, struct samu *user, const DOM_SID *sid)
+static NTSTATUS testsam_getsampwsid (struct pdb_methods *methods, struct samu *user, const struct dom_sid *sid)
{
DEBUG(10, ("testsam_getsampwsid called\n"));
return NT_STATUS_NOT_IMPLEMENTED;
NT_USER_TOKEN **token)
{
ADS_STATUS status;
- DOM_SID object_sid;
- DOM_SID primary_group_sid;
- DOM_SID *ad_token_sids;
+ struct dom_sid object_sid;
+ struct dom_sid primary_group_sid;
+ struct dom_sid *ad_token_sids;
size_t num_ad_token_sids = 0;
- DOM_SID *token_sids;
+ struct dom_sid *token_sids;
size_t num_token_sids = 0;
NT_USER_TOKEN *new_token = NULL;
int i;
return status;
}
- token_sids = TALLOC_ARRAY(mem_ctx, DOM_SID, 1);
+ token_sids = TALLOC_ARRAY(mem_ctx, struct dom_sid, 1);
ADS_ERROR_HAVE_NO_MEMORY(token_sids);
status = ADS_ERROR_NT(add_sid_to_array_unique(mem_ctx,
****************************************************************************/
static void sort_sid_array_for_smbd(struct auth_serversupplied_info *result,
- const DOM_SID *pgroup_sid)
+ const struct dom_sid *pgroup_sid)
{
unsigned int i;
for (i=1; i<server_info->ptok->num_sids; i++) {
gid_t gid;
- DOM_SID *sid = &server_info->ptok->user_sids[i];
+ struct dom_sid *sid = &server_info->ptok->user_sids[i];
if (!sid_to_gid(sid, &gid)) {
DEBUG(10, ("Could not convert SID %s to gid, "
gid_t *gids;
char *qualified_name = NULL;
TALLOC_CTX *mem_ctx = NULL;
- DOM_SID u_sid;
+ struct dom_sid u_sid;
enum lsa_SidType type;
struct auth_serversupplied_info *result;
{
NTSTATUS status;
struct samu *sampass = NULL;
- DOM_SID guest_sid;
+ struct dom_sid guest_sid;
bool ret;
static const char zeros[16] = {0, };
fstring tmp;
const char *nt_domain;
const char *nt_username;
struct samu *sam_account = NULL;
- DOM_SID user_sid;
- DOM_SID group_sid;
+ struct dom_sid user_sid;
+ struct dom_sid group_sid;
bool username_was_mapped;
uid_t uid = (uid_t)-1;
const char *nt_domain;
const char *nt_username;
struct samu *sam_account = NULL;
- DOM_SID user_sid;
- DOM_SID group_sid;
+ struct dom_sid user_sid;
+ struct dom_sid group_sid;
bool username_was_mapped;
uint32_t i;
/* Create a 'combined' list of all SIDs we might want in the SD */
result->num_sids = info->num_sids - 2;
- result->sids = talloc_array(result, DOM_SID, result->num_sids);
+ result->sids = talloc_array(result, struct dom_sid, result->num_sids);
if (result->sids == NULL) {
TALLOC_FREE(result);
return NT_STATUS_NO_MEMORY;
bool is_trusted_domain(const char* dom_name)
{
- DOM_SID trustdom_sid;
+ struct dom_sid trustdom_sid;
bool ret;
/* no trusted domains for a standalone server */
********************************************************************/
static NTSTATUS nt_token_to_group_list(TALLOC_CTX *mem_ctx,
- const DOM_SID *domain_sid,
+ const struct dom_sid *domain_sid,
size_t num_sids,
- const DOM_SID *sids,
+ const struct dom_sid *sids,
int *numgroups,
struct samr_RidWithAttribute **pgids)
{
{
struct samu *sampw;
struct samr_RidWithAttribute *gids = NULL;
- const DOM_SID *user_sid = NULL;
- const DOM_SID *group_sid = NULL;
- DOM_SID domain_sid;
+ const struct dom_sid *user_sid = NULL;
+ const struct dom_sid *group_sid = NULL;
+ struct dom_sid domain_sid;
uint32 user_rid, group_rid;
NTSTATUS status;
Check for a SID in an NT_USER_TOKEN
****************************************************************************/
-bool nt_token_check_sid ( const DOM_SID *sid, const NT_USER_TOKEN *token )
+bool nt_token_check_sid ( const struct dom_sid *sid, const NT_USER_TOKEN *token )
{
int i;
bool nt_token_check_domain_rid( NT_USER_TOKEN *token, uint32 rid )
{
- DOM_SID domain_sid;
+ struct dom_sid domain_sid;
/* if we are a domain member, the get the domain SID, else for
a DC or standalone server, use our own SID */
NT_USER_TOKEN *get_root_nt_token( void )
{
struct nt_user_token *token, *for_cache;
- DOM_SID u_sid, g_sid;
+ struct dom_sid u_sid, g_sid;
struct passwd *pw;
void *cache_data;
* Add alias SIDs from memberships within the partially created token SID list
*/
-NTSTATUS add_aliases(const DOM_SID *domain_sid,
+NTSTATUS add_aliases(const struct dom_sid *domain_sid,
struct nt_user_token *token)
{
uint32 *aliases;
}
for (i=0; i<num_aliases; i++) {
- DOM_SID alias_sid;
+ struct dom_sid alias_sid;
sid_compose(&alias_sid, domain_sid, aliases[i]);
status = add_sid_to_array_unique(token, &alias_sid,
&token->user_sids,
*******************************************************************/
static NTSTATUS add_builtin_administrators(struct nt_user_token *token,
- const DOM_SID *dom_sid)
+ const struct dom_sid *dom_sid)
{
- DOM_SID domadm;
+ struct dom_sid domadm;
NTSTATUS status;
/* nothing to do if we aren't in a domain */
static NTSTATUS create_builtin(uint32 rid)
{
NTSTATUS status = NT_STATUS_OK;
- DOM_SID sid;
+ struct dom_sid sid;
gid_t gid;
if (!sid_compose(&sid, &global_sid_Builtin, rid)) {
* @param[in] dom_sid sid to add as a member of builtin_sid.
* @return Normal NTSTATUS return
*/
-static NTSTATUS add_sid_to_builtin(const DOM_SID *builtin_sid,
- const DOM_SID *dom_sid)
+static NTSTATUS add_sid_to_builtin(const struct dom_sid *builtin_sid,
+ const struct dom_sid *dom_sid)
{
NTSTATUS status = NT_STATUS_OK;
/*******************************************************************
*******************************************************************/
-NTSTATUS create_builtin_users(const DOM_SID *dom_sid)
+NTSTATUS create_builtin_users(const struct dom_sid *dom_sid)
{
NTSTATUS status;
- DOM_SID dom_users;
+ struct dom_sid dom_users;
status = create_builtin(BUILTIN_RID_USERS);
if ( !NT_STATUS_IS_OK(status) ) {
/*******************************************************************
*******************************************************************/
-NTSTATUS create_builtin_administrators(const DOM_SID *dom_sid)
+NTSTATUS create_builtin_administrators(const struct dom_sid *dom_sid)
{
NTSTATUS status;
- DOM_SID dom_admins, root_sid;
+ struct dom_sid dom_admins, root_sid;
fstring root_name;
enum lsa_SidType type;
TALLOC_CTX *ctx;
*******************************************************************/
struct nt_user_token *create_local_nt_token(TALLOC_CTX *mem_ctx,
- const DOM_SID *user_sid,
+ const struct dom_sid *user_sid,
bool is_guest,
int num_groupsids,
- const DOM_SID *groupsids)
+ const struct dom_sid *groupsids)
{
struct nt_user_token *result = NULL;
int i;
NTSTATUS status;
gid_t gid;
- DOM_SID dom_sid;
+ struct dom_sid dom_sid;
DEBUG(10, ("Create local NT token for %s\n",
sid_string_dbg(user_sid)));
{
NTSTATUS result = NT_STATUS_NO_SUCH_USER;
TALLOC_CTX *tmp_ctx = talloc_stackframe();
- DOM_SID user_sid;
+ struct dom_sid user_sid;
enum lsa_SidType type;
gid_t *gids;
- DOM_SID *group_sids;
- DOM_SID unix_group_sid;
+ struct dom_sid *group_sids;
+ struct dom_sid unix_group_sid;
size_t num_group_sids;
size_t num_gids;
size_t i;
}
if (num_group_sids) {
- group_sids = TALLOC_ARRAY(tmp_ctx, DOM_SID, num_group_sids);
+ group_sids = TALLOC_ARRAY(tmp_ctx, struct dom_sid, num_group_sids);
if (group_sids == NULL) {
DEBUG(1, ("TALLOC_ARRAY failed\n"));
result = NT_STATUS_NO_MEMORY;
}
num_group_sids = 1;
- group_sids = TALLOC_ARRAY(tmp_ctx, DOM_SID, num_group_sids);
+ group_sids = TALLOC_ARRAY(tmp_ctx, struct dom_sid, num_group_sids);
if (group_sids == NULL) {
DEBUG(1, ("TALLOC_ARRAY failed\n"));
result = NT_STATUS_NO_MEMORY;
member of a particular group.
***************************************************************************/
-bool user_in_group_sid(const char *username, const DOM_SID *group_sid)
+bool user_in_group_sid(const char *username, const struct dom_sid *group_sid)
{
NTSTATUS status;
uid_t uid;
bool user_in_group(const char *username, const char *groupname)
{
TALLOC_CTX *mem_ctx = talloc_stackframe();
- DOM_SID group_sid;
+ struct dom_sid group_sid;
bool ret;
ret = lookup_name(mem_ctx, groupname, LOOKUP_NAME_ALL,
return pdb_add_group_mapping_entry(&map);
}
-static NTSTATUS alias_memberships(const DOM_SID *members, size_t num_members,
- DOM_SID **sids, size_t *num)
+static NTSTATUS alias_memberships(const struct dom_sid *members, size_t num_members,
+ struct dom_sid **sids, size_t *num)
{
size_t i;
}
struct aliasmem_closure {
- const DOM_SID *alias;
- DOM_SID **sids;
+ const struct dom_sid *alias;
+ struct dom_sid **sids;
size_t *num;
};
/* get a domain group from it's SID */
-bool get_domain_group_from_sid(DOM_SID sid, GROUP_MAP *map)
+bool get_domain_group_from_sid(struct dom_sid sid, GROUP_MAP *map)
{
struct group *grp;
bool ret;
NTSTATUS pdb_default_getgrsid(struct pdb_methods *methods, GROUP_MAP *map,
- DOM_SID sid)
+ struct dom_sid sid)
{
if (!init_group_mapping()) {
DEBUG(0,("failed to initialize group mapping\n"));
}
NTSTATUS pdb_default_delete_group_mapping_entry(struct pdb_methods *methods,
- DOM_SID sid)
+ struct dom_sid sid)
{
if (!init_group_mapping()) {
DEBUG(0,("failed to initialize group mapping\n"));
}
NTSTATUS pdb_default_enum_group_mapping(struct pdb_methods *methods,
- const DOM_SID *sid, enum lsa_SidType sid_name_use,
+ const struct dom_sid *sid, enum lsa_SidType sid_name_use,
GROUP_MAP **pp_rmap, size_t *p_num_entries,
bool unix_only)
{
NTSTATUS pdb_default_create_alias(struct pdb_methods *methods,
const char *name, uint32 *rid)
{
- DOM_SID sid;
+ struct dom_sid sid;
enum lsa_SidType type;
uint32 new_rid;
gid_t gid;
}
NTSTATUS pdb_default_delete_alias(struct pdb_methods *methods,
- const DOM_SID *sid)
+ const struct dom_sid *sid)
{
return pdb_delete_group_mapping_entry(*sid);
}
NTSTATUS pdb_default_get_aliasinfo(struct pdb_methods *methods,
- const DOM_SID *sid,
+ const struct dom_sid *sid,
struct acct_info *info)
{
GROUP_MAP map;
}
NTSTATUS pdb_default_set_aliasinfo(struct pdb_methods *methods,
- const DOM_SID *sid,
+ const struct dom_sid *sid,
struct acct_info *info)
{
GROUP_MAP map;
}
NTSTATUS pdb_default_add_aliasmem(struct pdb_methods *methods,
- const DOM_SID *alias, const DOM_SID *member)
+ const struct dom_sid *alias, const struct dom_sid *member)
{
if (!init_group_mapping()) {
DEBUG(0,("failed to initialize group mapping\n"));
}
NTSTATUS pdb_default_del_aliasmem(struct pdb_methods *methods,
- const DOM_SID *alias, const DOM_SID *member)
+ const struct dom_sid *alias, const struct dom_sid *member)
{
if (!init_group_mapping()) {
DEBUG(0,("failed to initialize group mapping\n"));
}
NTSTATUS pdb_default_enum_aliasmem(struct pdb_methods *methods,
- const DOM_SID *alias, TALLOC_CTX *mem_ctx,
- DOM_SID **pp_members, size_t *p_num_members)
+ const struct dom_sid *alias, TALLOC_CTX *mem_ctx,
+ struct dom_sid **pp_members, size_t *p_num_members)
{
if (!init_group_mapping()) {
DEBUG(0,("failed to initialize group mapping\n"));
NTSTATUS pdb_default_alias_memberships(struct pdb_methods *methods,
TALLOC_CTX *mem_ctx,
- const DOM_SID *domain_sid,
- const DOM_SID *members,
+ const struct dom_sid *domain_sid,
+ const struct dom_sid *members,
size_t num_members,
uint32 **pp_alias_rids,
size_t *p_num_alias_rids)
{
- DOM_SID *alias_sids;
+ struct dom_sid *alias_sids;
size_t i, num_alias_sids;
NTSTATUS result;
*********************************************************************/
NTSTATUS pdb_nop_getgrsid(struct pdb_methods *methods, GROUP_MAP *map,
- DOM_SID sid)
+ struct dom_sid sid)
{
return NT_STATUS_UNSUCCESSFUL;
}
}
NTSTATUS pdb_nop_delete_group_mapping_entry(struct pdb_methods *methods,
- DOM_SID sid)
+ struct dom_sid sid)
{
return NT_STATUS_UNSUCCESSFUL;
}
/****************************************************************************
These need to be redirected through pdb_interface.c
****************************************************************************/
-bool pdb_get_dom_grp_info(const DOM_SID *sid, struct acct_info *info)
+bool pdb_get_dom_grp_info(const struct dom_sid *sid, struct acct_info *info)
{
GROUP_MAP map;
bool res;
return True;
}
-bool pdb_set_dom_grp_info(const DOM_SID *sid, const struct acct_info *info)
+bool pdb_set_dom_grp_info(const struct dom_sid *sid, const struct acct_info *info)
{
GROUP_MAP map;
NTSTATUS pdb_create_builtin_alias(uint32 rid)
{
- DOM_SID sid;
+ struct dom_sid sid;
enum lsa_SidType type;
gid_t gid;
GROUP_MAP map;
struct mapping_backend {
bool (*init_group_mapping)(void);
bool (*add_mapping_entry)(GROUP_MAP *map, int flag);
- bool (*get_group_map_from_sid)(DOM_SID sid, GROUP_MAP *map);
+ bool (*get_group_map_from_sid)(struct dom_sid sid, GROUP_MAP *map);
bool (*get_group_map_from_gid)(gid_t gid, GROUP_MAP *map);
bool (*get_group_map_from_ntname)(const char *name, GROUP_MAP *map);
- bool (*group_map_remove)(const DOM_SID *sid);
- bool (*enum_group_mapping)(const DOM_SID *domsid, enum lsa_SidType sid_name_use,
+ bool (*group_map_remove)(const struct dom_sid *sid);
+ bool (*enum_group_mapping)(const struct dom_sid *domsid, enum lsa_SidType sid_name_use,
GROUP_MAP **pp_rmap,
size_t *p_num_entries, bool unix_only);
- NTSTATUS (*one_alias_membership)(const DOM_SID *member,
- DOM_SID **sids, size_t *num);
- NTSTATUS (*add_aliasmem)(const DOM_SID *alias, const DOM_SID *member);
- NTSTATUS (*del_aliasmem)(const DOM_SID *alias, const DOM_SID *member);
- NTSTATUS (*enum_aliasmem)(const DOM_SID *alias, TALLOC_CTX *mem_ctx,
- DOM_SID **sids, size_t *num);
+ NTSTATUS (*one_alias_membership)(const struct dom_sid *member,
+ struct dom_sid **sids, size_t *num);
+ NTSTATUS (*add_aliasmem)(const struct dom_sid *alias, const struct dom_sid *member);
+ NTSTATUS (*del_aliasmem)(const struct dom_sid *alias, const struct dom_sid *member);
+ NTSTATUS (*enum_aliasmem)(const struct dom_sid *alias, TALLOC_CTX *mem_ctx,
+ struct dom_sid **sids, size_t *num);
};
static struct db_context *db; /* used for driver files */
-static bool enum_group_mapping(const DOM_SID *domsid,
+static bool enum_group_mapping(const struct dom_sid *domsid,
enum lsa_SidType sid_name_use,
GROUP_MAP **pp_rmap,
size_t *p_num_entries,
bool unix_only);
-static bool group_map_remove(const DOM_SID *sid);
+static bool group_map_remove(const struct dom_sid *sid);
static bool mapping_switch(const char *ldb_path);
return true;
}
-static char *group_mapping_key(TALLOC_CTX *mem_ctx, const DOM_SID *sid)
+static char *group_mapping_key(TALLOC_CTX *mem_ctx, const struct dom_sid *sid)
{
char *sidstr, *result;
Return the sid and the type of the unix group.
****************************************************************************/
-static bool get_group_map_from_sid(DOM_SID sid, GROUP_MAP *map)
+static bool get_group_map_from_sid(struct dom_sid sid, GROUP_MAP *map)
{
TDB_DATA dbuf;
char *key;
Remove a group mapping entry.
****************************************************************************/
-static bool group_map_remove(const DOM_SID *sid)
+static bool group_map_remove(const struct dom_sid *sid)
{
char *key;
NTSTATUS status;
****************************************************************************/
struct enum_map_state {
- const DOM_SID *domsid;
+ const struct dom_sid *domsid;
enum lsa_SidType sid_name_use;
bool unix_only;
return 0;
}
-static bool enum_group_mapping(const DOM_SID *domsid,
+static bool enum_group_mapping(const struct dom_sid *domsid,
enum lsa_SidType sid_name_use,
GROUP_MAP **pp_rmap,
size_t *p_num_entries, bool unix_only)
/* This operation happens on session setup, so it should better be fast. We
* store a list of aliases a SID is member of hanging off MEMBEROF/SID. */
-static NTSTATUS one_alias_membership(const DOM_SID *member,
- DOM_SID **sids, size_t *num)
+static NTSTATUS one_alias_membership(const struct dom_sid *member,
+ struct dom_sid **sids, size_t *num)
{
fstring tmp;
fstring key;
p = (const char *)dbuf.dptr;
while (next_token_talloc(frame, &p, &string_sid, " ")) {
- DOM_SID alias;
+ struct dom_sid alias;
if (!string_to_sid(&alias, string_sid))
continue;
return status;
}
-static NTSTATUS alias_memberships(const DOM_SID *members, size_t num_members,
- DOM_SID **sids, size_t *num)
+static NTSTATUS alias_memberships(const struct dom_sid *members, size_t num_members,
+ struct dom_sid **sids, size_t *num)
{
size_t i;
return NT_STATUS_OK;
}
-static bool is_aliasmem(const DOM_SID *alias, const DOM_SID *member)
+static bool is_aliasmem(const struct dom_sid *alias, const struct dom_sid *member)
{
- DOM_SID *sids;
+ struct dom_sid *sids;
size_t i, num;
/* This feels the wrong way round, but the on-disk data structure
}
-static NTSTATUS add_aliasmem(const DOM_SID *alias, const DOM_SID *member)
+static NTSTATUS add_aliasmem(const struct dom_sid *alias, const struct dom_sid *member)
{
GROUP_MAP map;
char *key;
struct aliasmem_state {
TALLOC_CTX *mem_ctx;
- const DOM_SID *alias;
- DOM_SID **sids;
+ const struct dom_sid *alias;
+ struct dom_sid **sids;
size_t *num;
};
frame = talloc_stackframe();
while (next_token_talloc(frame, &p, &alias_string, " ")) {
- DOM_SID alias, member;
+ struct dom_sid alias, member;
const char *member_string;
if (!string_to_sid(&alias, alias_string))
return 0;
}
-static NTSTATUS enum_aliasmem(const DOM_SID *alias, TALLOC_CTX *mem_ctx,
- DOM_SID **sids, size_t *num)
+static NTSTATUS enum_aliasmem(const struct dom_sid *alias, TALLOC_CTX *mem_ctx,
+ struct dom_sid **sids, size_t *num)
{
GROUP_MAP map;
struct aliasmem_state state;
return NT_STATUS_OK;
}
-static NTSTATUS del_aliasmem(const DOM_SID *alias, const DOM_SID *member)
+static NTSTATUS del_aliasmem(const struct dom_sid *alias, const struct dom_sid *member)
{
NTSTATUS status;
- DOM_SID *sids;
+ struct dom_sid *sids;
size_t i, num;
bool found = False;
char *member_string;
char *val;
char *q;
uint32_t num_mem = 0;
- DOM_SID *members = NULL;
+ struct dom_sid *members = NULL;
p = (uint8_t *)data.dptr;
if (data.dsize < 8) {
num_vals = pull_uint32(p, 0);
if (StrCaseCmp(name, "member") == 0) {
num_mem = num_vals;
- members = talloc_array(tmp_ctx, DOM_SID, num_mem);
+ members = talloc_array(tmp_ctx, struct dom_sid, num_mem);
if (members == NULL) {
errno = ENOMEM;
goto failed;
uint32 *v);
bool ads_pull_guid(ADS_STRUCT *ads, LDAPMessage *msg, struct GUID *guid);
bool ads_pull_sid(ADS_STRUCT *ads, LDAPMessage *msg, const char *field,
- DOM_SID *sid);
+ struct dom_sid *sid);
int ads_pull_sids(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx,
- LDAPMessage *msg, const char *field, DOM_SID **sids);
+ LDAPMessage *msg, const char *field, struct dom_sid **sids);
bool ads_pull_sd(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx,
LDAPMessage *msg, const char *field, struct security_descriptor **sd);
char *ads_pull_username(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx,
LDAPMessage *msg,
const char *field,
enum ads_extended_dn_flags flags,
- DOM_SID **sids);
+ struct dom_sid **sids);
ADS_STATUS ads_find_machine_acct(ADS_STRUCT *ads, LDAPMessage **res,
const char *machine);
char ***strings,
size_t *num_strings);
ADS_STATUS ads_search_retry_sid(ADS_STRUCT *ads, LDAPMessage **res,
- const DOM_SID *sid,
+ const struct dom_sid *sid,
const char **attrs);
ADS_STATUS ads_get_tokensids(ADS_STRUCT *ads,
TALLOC_CTX *mem_ctx,
const char *dn,
- DOM_SID *user_sid,
- DOM_SID *primary_group_sid,
- DOM_SID **sids,
+ struct dom_sid *user_sid,
+ struct dom_sid *primary_group_sid,
+ struct dom_sid **sids,
size_t *num_sids);
ADS_STATUS ads_get_joinable_ous(ADS_STRUCT *ads,
TALLOC_CTX *mem_ctx,
struct auth_serversupplied_info {
bool guest;
- DOM_SID *sids; /* These SIDs are preliminary between
+ struct dom_sid *sids; /* These SIDs are preliminary between
check_ntlm_password and the token creation. */
size_t num_sids;
typedef struct _GROUP_MAP {
struct pdb_methods *methods;
gid_t gid;
- DOM_SID sid;
+ struct dom_sid sid;
enum lsa_SidType sid_name_use;
fstring nt_name;
fstring comment;
struct nss_info_methods {
NTSTATUS (*init)( struct nss_domain_entry *e );
NTSTATUS (*get_nss_info)( struct nss_domain_entry *e,
- const DOM_SID *sid,
+ const struct dom_sid *sid,
TALLOC_CTX *ctx,
ADS_STRUCT *ads, LDAPMessage *msg,
const char **homedir, const char **shell,
const char *name,
struct nss_info_methods *methods);
-NTSTATUS nss_get_info( const char *domain, const DOM_SID *user_sid,
+NTSTATUS nss_get_info( const char *domain, const struct dom_sid *user_sid,
TALLOC_CTX *ctx,
ADS_STRUCT *ads, LDAPMessage *msg,
const char **homedir, const char **shell,
uint64_t softlim;
uint64_t hardlim;
uint32 qflags;
- DOM_SID sid;
+ struct dom_sid sid;
} SMB_NTQUOTA_STRUCT;
typedef struct _SMB_NTQUOTA_LIST {
const char *comment;
const char *munged_dial; /* munged path name and dial-back tel number */
- DOM_SID user_sid;
- DOM_SID *group_sid;
+ struct dom_sid user_sid;
+ struct dom_sid *group_sid;
DATA_BLOB lm_pw; /* .data is Null if no password */
DATA_BLOB nt_pw; /* .data is Null if no password */
NTSTATUS (*getsampwnam)(struct pdb_methods *, struct samu *sam_acct, const char *username);
- NTSTATUS (*getsampwsid)(struct pdb_methods *, struct samu *sam_acct, const DOM_SID *sid);
+ NTSTATUS (*getsampwsid)(struct pdb_methods *, struct samu *sam_acct, const struct dom_sid *sid);
NTSTATUS (*create_user)(struct pdb_methods *, TALLOC_CTX *tmp_ctx,
const char *name, uint32_t acct_flags,
NTSTATUS (*update_login_attempts)(struct pdb_methods *methods, struct samu *sam_acct, bool success);
- NTSTATUS (*getgrsid)(struct pdb_methods *methods, GROUP_MAP *map, DOM_SID sid);
+ NTSTATUS (*getgrsid)(struct pdb_methods *methods, GROUP_MAP *map, struct dom_sid sid);
NTSTATUS (*getgrgid)(struct pdb_methods *methods, GROUP_MAP *map, gid_t gid);
GROUP_MAP *map);
NTSTATUS (*delete_group_mapping_entry)(struct pdb_methods *methods,
- DOM_SID sid);
+ struct dom_sid sid);
NTSTATUS (*enum_group_mapping)(struct pdb_methods *methods,
- const DOM_SID *sid, enum lsa_SidType sid_name_use,
+ const struct dom_sid *sid, enum lsa_SidType sid_name_use,
GROUP_MAP **pp_rmap, size_t *p_num_entries,
bool unix_only);
NTSTATUS (*enum_group_members)(struct pdb_methods *methods,
TALLOC_CTX *mem_ctx,
- const DOM_SID *group,
+ const struct dom_sid *group,
uint32_t **pp_member_rids,
size_t *p_num_members);
NTSTATUS (*enum_group_memberships)(struct pdb_methods *methods,
TALLOC_CTX *mem_ctx,
struct samu *user,
- DOM_SID **pp_sids, gid_t **pp_gids,
+ struct dom_sid **pp_sids, gid_t **pp_gids,
size_t *p_num_groups);
NTSTATUS (*set_unix_primary_group)(struct pdb_methods *methods,
const char *name, uint32_t *rid);
NTSTATUS (*delete_alias)(struct pdb_methods *methods,
- const DOM_SID *sid);
+ const struct dom_sid *sid);
NTSTATUS (*get_aliasinfo)(struct pdb_methods *methods,
- const DOM_SID *sid,
+ const struct dom_sid *sid,
struct acct_info *info);
NTSTATUS (*set_aliasinfo)(struct pdb_methods *methods,
- const DOM_SID *sid,
+ const struct dom_sid *sid,
struct acct_info *info);
NTSTATUS (*add_aliasmem)(struct pdb_methods *methods,
- const DOM_SID *alias, const DOM_SID *member);
+ const struct dom_sid *alias, const struct dom_sid *member);
NTSTATUS (*del_aliasmem)(struct pdb_methods *methods,
- const DOM_SID *alias, const DOM_SID *member);
+ const struct dom_sid *alias, const struct dom_sid *member);
NTSTATUS (*enum_aliasmem)(struct pdb_methods *methods,
- const DOM_SID *alias, TALLOC_CTX *mem_ctx,
- DOM_SID **members, size_t *p_num_members);
+ const struct dom_sid *alias, TALLOC_CTX *mem_ctx,
+ struct dom_sid **members, size_t *p_num_members);
NTSTATUS (*enum_alias_memberships)(struct pdb_methods *methods,
TALLOC_CTX *mem_ctx,
- const DOM_SID *domain_sid,
- const DOM_SID *members,
+ const struct dom_sid *domain_sid,
+ const struct dom_sid *members,
size_t num_members,
uint32_t **pp_alias_rids,
size_t *p_num_alias_rids);
NTSTATUS (*lookup_rids)(struct pdb_methods *methods,
- const DOM_SID *domain_sid,
+ const struct dom_sid *domain_sid,
int num_rids,
uint32_t *rids,
const char **pp_names,
enum lsa_SidType *attrs);
NTSTATUS (*lookup_names)(struct pdb_methods *methods,
- const DOM_SID *domain_sid,
+ const struct dom_sid *domain_sid,
int num_names,
const char **pp_names,
uint32_t *rids,
struct pdb_search *search);
bool (*search_aliases)(struct pdb_methods *methods,
struct pdb_search *search,
- const DOM_SID *sid);
+ const struct dom_sid *sid);
bool (*uid_to_sid)(struct pdb_methods *methods, uid_t uid,
- DOM_SID *sid);
+ struct dom_sid *sid);
bool (*gid_to_sid)(struct pdb_methods *methods, gid_t gid,
- DOM_SID *sid);
- bool (*sid_to_id)(struct pdb_methods *methods, const DOM_SID *sid,
+ struct dom_sid *sid);
+ bool (*sid_to_id)(struct pdb_methods *methods, const struct dom_sid *sid,
union unid_t *id, enum lsa_SidType *type);
uint32_t (*capabilities)(struct pdb_methods *methods);
bool (*get_trusteddom_pw)(struct pdb_methods *methods,
const char *domain, char** pwd,
- DOM_SID *sid, time_t *pass_last_set_time);
+ struct dom_sid *sid, time_t *pass_last_set_time);
bool (*set_trusteddom_pw)(struct pdb_methods *methods,
const char* domain, const char* pwd,
- const DOM_SID *sid);
+ const struct dom_sid *sid);
bool (*del_trusteddom_pw)(struct pdb_methods *methods,
const char *domain);
NTSTATUS (*enum_trusteddoms)(struct pdb_methods *methods,
uid_t *uid, gid_t *gid,
char **found_username,
struct nt_user_token **token);
-bool user_in_group_sid(const char *username, const DOM_SID *group_sid);
+bool user_in_group_sid(const char *username, const struct dom_sid *group_sid);
bool user_in_group(const char *username, const char *groupname);
NTSTATUS make_server_info_pw(struct auth_serversupplied_info **server_info,
char *unix_username,
/* The following definitions come from auth/token_util.c */
-bool nt_token_check_sid ( const DOM_SID *sid, const NT_USER_TOKEN *token );
+bool nt_token_check_sid ( const struct dom_sid *sid, const NT_USER_TOKEN *token );
bool nt_token_check_domain_rid( NT_USER_TOKEN *token, uint32 rid );
NT_USER_TOKEN *get_root_nt_token( void );
-NTSTATUS add_aliases(const DOM_SID *domain_sid,
+NTSTATUS add_aliases(const struct dom_sid *domain_sid,
struct nt_user_token *token);
-NTSTATUS create_builtin_users(const DOM_SID *sid);
-NTSTATUS create_builtin_administrators(const DOM_SID *sid);
+NTSTATUS create_builtin_users(const struct dom_sid *sid);
+NTSTATUS create_builtin_administrators(const struct dom_sid *sid);
struct nt_user_token *create_local_nt_token(TALLOC_CTX *mem_ctx,
- const DOM_SID *user_sid,
+ const struct dom_sid *user_sid,
bool is_guest,
int num_groupsids,
- const DOM_SID *groupsids);
+ const struct dom_sid *groupsids);
void debug_nt_user_token(int dbg_class, int dbg_lev, NT_USER_TOKEN *token);
void debug_unix_user_token(int dbg_class, int dbg_lev, uid_t uid, gid_t gid,
int n_groups, gid_t *groups);
/* The following definitions come from groupdb/mapping.c */
NTSTATUS add_initial_entry(gid_t gid, const char *sid, enum lsa_SidType sid_name_use, const char *nt_name, const char *comment);
-bool get_domain_group_from_sid(DOM_SID sid, GROUP_MAP *map);
+bool get_domain_group_from_sid(struct dom_sid sid, GROUP_MAP *map);
int smb_create_group(const char *unix_group, gid_t *new_gid);
int smb_delete_group(const char *unix_group);
int smb_set_primary_group(const char *unix_group, const char* unix_user);
int smb_add_user_group(const char *unix_group, const char *unix_user);
int smb_delete_user_group(const char *unix_group, const char *unix_user);
NTSTATUS pdb_default_getgrsid(struct pdb_methods *methods, GROUP_MAP *map,
- DOM_SID sid);
+ struct dom_sid sid);
NTSTATUS pdb_default_getgrgid(struct pdb_methods *methods, GROUP_MAP *map,
gid_t gid);
NTSTATUS pdb_default_getgrnam(struct pdb_methods *methods, GROUP_MAP *map,
NTSTATUS pdb_default_update_group_mapping_entry(struct pdb_methods *methods,
GROUP_MAP *map);
NTSTATUS pdb_default_delete_group_mapping_entry(struct pdb_methods *methods,
- DOM_SID sid);
+ struct dom_sid sid);
NTSTATUS pdb_default_enum_group_mapping(struct pdb_methods *methods,
- const DOM_SID *sid, enum lsa_SidType sid_name_use,
+ const struct dom_sid *sid, enum lsa_SidType sid_name_use,
GROUP_MAP **pp_rmap, size_t *p_num_entries,
bool unix_only);
NTSTATUS pdb_default_create_alias(struct pdb_methods *methods,
const char *name, uint32 *rid);
NTSTATUS pdb_default_delete_alias(struct pdb_methods *methods,
- const DOM_SID *sid);
+ const struct dom_sid *sid);
NTSTATUS pdb_default_get_aliasinfo(struct pdb_methods *methods,
- const DOM_SID *sid,
+ const struct dom_sid *sid,
struct acct_info *info);
NTSTATUS pdb_default_set_aliasinfo(struct pdb_methods *methods,
- const DOM_SID *sid,
+ const struct dom_sid *sid,
struct acct_info *info);
NTSTATUS pdb_default_add_aliasmem(struct pdb_methods *methods,
- const DOM_SID *alias, const DOM_SID *member);
+ const struct dom_sid *alias, const struct dom_sid *member);
NTSTATUS pdb_default_del_aliasmem(struct pdb_methods *methods,
- const DOM_SID *alias, const DOM_SID *member);
+ const struct dom_sid *alias, const struct dom_sid *member);
NTSTATUS pdb_default_enum_aliasmem(struct pdb_methods *methods,
- const DOM_SID *alias, TALLOC_CTX *mem_ctx,
- DOM_SID **pp_members,
+ const struct dom_sid *alias, TALLOC_CTX *mem_ctx,
+ struct dom_sid **pp_members,
size_t *p_num_members);
NTSTATUS pdb_default_alias_memberships(struct pdb_methods *methods,
TALLOC_CTX *mem_ctx,
- const DOM_SID *domain_sid,
- const DOM_SID *members,
+ const struct dom_sid *domain_sid,
+ const struct dom_sid *members,
size_t num_members,
uint32 **pp_alias_rids,
size_t *p_num_alias_rids);
NTSTATUS pdb_nop_getgrsid(struct pdb_methods *methods, GROUP_MAP *map,
- DOM_SID sid);
+ struct dom_sid sid);
NTSTATUS pdb_nop_getgrgid(struct pdb_methods *methods, GROUP_MAP *map,
gid_t gid);
NTSTATUS pdb_nop_getgrnam(struct pdb_methods *methods, GROUP_MAP *map,
NTSTATUS pdb_nop_update_group_mapping_entry(struct pdb_methods *methods,
GROUP_MAP *map);
NTSTATUS pdb_nop_delete_group_mapping_entry(struct pdb_methods *methods,
- DOM_SID sid);
+ struct dom_sid sid);
NTSTATUS pdb_nop_enum_group_mapping(struct pdb_methods *methods,
enum lsa_SidType sid_name_use,
GROUP_MAP **rmap, size_t *num_entries,
bool unix_only);
-bool pdb_get_dom_grp_info(const DOM_SID *sid, struct acct_info *info);
-bool pdb_set_dom_grp_info(const DOM_SID *sid, const struct acct_info *info);
+bool pdb_get_dom_grp_info(const struct dom_sid *sid, struct acct_info *info);
+bool pdb_set_dom_grp_info(const struct dom_sid *sid, const struct acct_info *info);
NTSTATUS pdb_create_builtin_alias(uint32 rid);
/* The following definitions come from groupdb/mapping_ldb.c */
/* The following definitions come from lib/privileges.c */
-bool get_privileges_for_sids(SE_PRIV *privileges, DOM_SID *slist, int scount);
-NTSTATUS privilege_enumerate_accounts(DOM_SID **sids, int *num_sids);
+bool get_privileges_for_sids(SE_PRIV *privileges, struct dom_sid *slist, int scount);
+NTSTATUS privilege_enumerate_accounts(struct dom_sid **sids, int *num_sids);
NTSTATUS privilege_enum_sids(const SE_PRIV *mask, TALLOC_CTX *mem_ctx,
- DOM_SID **sids, int *num_sids);
-bool grant_privilege(const DOM_SID *sid, const SE_PRIV *priv_mask);
-bool grant_privilege_by_name(DOM_SID *sid, const char *name);
-bool revoke_privilege(const DOM_SID *sid, const SE_PRIV *priv_mask);
-bool revoke_all_privileges( DOM_SID *sid );
-bool revoke_privilege_by_name(DOM_SID *sid, const char *name);
-NTSTATUS privilege_create_account(const DOM_SID *sid );
+ struct dom_sid **sids, int *num_sids);
+bool grant_privilege(const struct dom_sid *sid, const SE_PRIV *priv_mask);
+bool grant_privilege_by_name(struct dom_sid *sid, const char *name);
+bool revoke_privilege(const struct dom_sid *sid, const SE_PRIV *priv_mask);
+bool revoke_all_privileges( struct dom_sid *sid );
+bool revoke_privilege_by_name(struct dom_sid *sid, const char *name);
+NTSTATUS privilege_create_account(const struct dom_sid *sid );
NTSTATUS privilege_delete_account(const struct dom_sid *sid);
NTSTATUS privilege_set_init(PRIVILEGE_SET *priv_set);
NTSTATUS privilege_set_init_by_ctx(TALLOC_CTX *mem_ctx, PRIVILEGE_SET *priv_set);
void privilege_set_free(PRIVILEGE_SET *priv_set);
NTSTATUS dup_luid_attr(TALLOC_CTX *mem_ctx, LUID_ATTR **new_la, LUID_ATTR *old_la, int count);
-bool is_privileged_sid( const DOM_SID *sid );
-bool grant_all_privileges( const DOM_SID *sid );
+bool is_privileged_sid( const struct dom_sid *sid );
+bool grant_all_privileges( const struct dom_sid *sid );
/* The following definitions come from lib/privileges_basic.c */
struct security_descriptor *make_sec_desc(TALLOC_CTX *ctx,
enum security_descriptor_revision revision,
uint16 type,
- const DOM_SID *owner_sid, const DOM_SID *grp_sid,
+ const struct dom_sid *owner_sid, const struct dom_sid *grp_sid,
struct security_acl *sacl, struct security_acl *dacl, size_t *sd_size);
struct security_descriptor *dup_sec_desc(TALLOC_CTX *ctx, const struct security_descriptor *src);
NTSTATUS marshall_sec_desc(TALLOC_CTX *mem_ctx,
struct security_descriptor **psecdesc);
NTSTATUS unmarshall_sec_desc_buf(TALLOC_CTX *mem_ctx, uint8_t *data, size_t len,
struct sec_desc_buf **psecdesc_buf);
-struct security_descriptor *make_standard_sec_desc(TALLOC_CTX *ctx, const DOM_SID *owner_sid, const DOM_SID *grp_sid,
+struct security_descriptor *make_standard_sec_desc(TALLOC_CTX *ctx, const struct dom_sid *owner_sid, const struct dom_sid *grp_sid,
struct security_acl *dacl, size_t *sd_size);
struct sec_desc_buf *make_sec_desc_buf(TALLOC_CTX *ctx, size_t len, struct security_descriptor *sec_desc);
struct sec_desc_buf *dup_sec_desc_buf(TALLOC_CTX *ctx, struct sec_desc_buf *src);
-NTSTATUS sec_desc_add_sid(TALLOC_CTX *ctx, struct security_descriptor **psd, DOM_SID *sid, uint32 mask, size_t *sd_size);
-NTSTATUS sec_desc_mod_sid(struct security_descriptor *sd, DOM_SID *sid, uint32 mask);
-NTSTATUS sec_desc_del_sid(TALLOC_CTX *ctx, struct security_descriptor **psd, DOM_SID *sid, size_t *sd_size);
+NTSTATUS sec_desc_add_sid(TALLOC_CTX *ctx, struct security_descriptor **psd, struct dom_sid *sid, uint32 mask, size_t *sd_size);
+NTSTATUS sec_desc_mod_sid(struct security_descriptor *sd, struct dom_sid *sid, uint32 mask);
+NTSTATUS sec_desc_del_sid(TALLOC_CTX *ctx, struct security_descriptor **psd, struct dom_sid *sid, size_t *sd_size);
bool sd_has_inheritable_components(const struct security_descriptor *parent_ctr, bool container);
NTSTATUS se_create_child_secdesc(TALLOC_CTX *ctx,
struct security_descriptor **ppsd,
size_t *psize,
const struct security_descriptor *parent_ctr,
- const DOM_SID *owner_sid,
- const DOM_SID *group_sid,
+ const struct dom_sid *owner_sid,
+ const struct dom_sid *group_sid,
bool container);
NTSTATUS se_create_child_secdesc_buf(TALLOC_CTX *ctx,
struct sec_desc_buf **ppsdb,
const char *sid_type_lookup(uint32 sid_type) ;
NT_USER_TOKEN *get_system_token(void) ;
const char *get_global_sam_name(void) ;
-char *sid_to_fstring(fstring sidstr_out, const DOM_SID *sid);
-char *sid_string_talloc(TALLOC_CTX *mem_ctx, const DOM_SID *sid);
-char *sid_string_dbg(const DOM_SID *sid);
-char *sid_string_tos(const DOM_SID *sid);
-bool string_to_sid(DOM_SID *sidout, const char *sidstr);
-bool sid_append_rid(DOM_SID *sid, uint32 rid);
-bool sid_compose(DOM_SID *dst, const DOM_SID *domain_sid, uint32 rid);
-bool sid_split_rid(DOM_SID *sid, uint32 *rid);
-bool sid_peek_rid(const DOM_SID *sid, uint32 *rid);
-bool sid_peek_check_rid(const DOM_SID *exp_dom_sid, const DOM_SID *sid, uint32 *rid);
-void sid_copy(DOM_SID *dst, const DOM_SID *src);
-bool sid_linearize(char *outbuf, size_t len, const DOM_SID *sid);
-bool sid_parse(const char *inbuf, size_t len, DOM_SID *sid);
-int sid_compare(const DOM_SID *sid1, const DOM_SID *sid2);
-int sid_compare_domain(const DOM_SID *sid1, const DOM_SID *sid2);
-bool sid_equal(const DOM_SID *sid1, const DOM_SID *sid2);
-bool non_mappable_sid(DOM_SID *sid);
-char *sid_binstring(TALLOC_CTX *mem_ctx, const DOM_SID *sid);
-char *sid_binstring_hex(const DOM_SID *sid);
-DOM_SID *sid_dup_talloc(TALLOC_CTX *ctx, const DOM_SID *src);
-NTSTATUS add_sid_to_array(TALLOC_CTX *mem_ctx, const DOM_SID *sid,
- DOM_SID **sids, size_t *num);
-NTSTATUS add_sid_to_array_unique(TALLOC_CTX *mem_ctx, const DOM_SID *sid,
- DOM_SID **sids, size_t *num_sids);
-void del_sid_from_array(const DOM_SID *sid, DOM_SID **sids, size_t *num);
+char *sid_to_fstring(fstring sidstr_out, const struct dom_sid *sid);
+char *sid_string_talloc(TALLOC_CTX *mem_ctx, const struct dom_sid *sid);
+char *sid_string_dbg(const struct dom_sid *sid);
+char *sid_string_tos(const struct dom_sid *sid);
+bool string_to_sid(struct dom_sid *sidout, const char *sidstr);
+bool sid_append_rid(struct dom_sid *sid, uint32 rid);
+bool sid_compose(struct dom_sid *dst, const struct dom_sid *domain_sid, uint32 rid);
+bool sid_split_rid(struct dom_sid *sid, uint32 *rid);
+bool sid_peek_rid(const struct dom_sid *sid, uint32 *rid);
+bool sid_peek_check_rid(const struct dom_sid *exp_dom_sid, const struct dom_sid *sid, uint32 *rid);
+void sid_copy(struct dom_sid *dst, const struct dom_sid *src);
+bool sid_linearize(char *outbuf, size_t len, const struct dom_sid *sid);
+bool sid_parse(const char *inbuf, size_t len, struct dom_sid *sid);
+int sid_compare(const struct dom_sid *sid1, const struct dom_sid *sid2);
+int sid_compare_domain(const struct dom_sid *sid1, const struct dom_sid *sid2);
+bool sid_equal(const struct dom_sid *sid1, const struct dom_sid *sid2);
+bool non_mappable_sid(struct dom_sid *sid);
+char *sid_binstring(TALLOC_CTX *mem_ctx, const struct dom_sid *sid);
+char *sid_binstring_hex(const struct dom_sid *sid);
+struct dom_sid *sid_dup_talloc(TALLOC_CTX *ctx, const struct dom_sid *src);
+NTSTATUS add_sid_to_array(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
+ struct dom_sid **sids, size_t *num);
+NTSTATUS add_sid_to_array_unique(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
+ struct dom_sid **sids, size_t *num_sids);
+void del_sid_from_array(const struct dom_sid *sid, struct dom_sid **sids, size_t *num);
bool add_rid_to_array_unique(TALLOC_CTX *mem_ctx,
uint32 rid, uint32 **pp_rids, size_t *p_num);
-bool is_null_sid(const DOM_SID *sid);
-bool is_sid_in_token(const NT_USER_TOKEN *token, const DOM_SID *sid);
+bool is_null_sid(const struct dom_sid *sid);
+bool is_sid_in_token(const NT_USER_TOKEN *token, const struct dom_sid *sid);
NTSTATUS sid_array_from_info3(TALLOC_CTX *mem_ctx,
const struct netr_SamInfo3 *info3,
- DOM_SID **user_sids,
+ struct dom_sid **user_sids,
size_t *num_user_sids,
bool include_user_group_rid,
bool skip_ressource_groups);
/* The following definitions come from lib/winbind_util.c */
-bool winbind_lookup_name(const char *dom_name, const char *name, DOM_SID *sid,
+bool winbind_lookup_name(const char *dom_name, const char *name, struct dom_sid *sid,
enum lsa_SidType *name_type);
-bool winbind_lookup_sid(TALLOC_CTX *mem_ctx, const DOM_SID *sid,
+bool winbind_lookup_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
const char **domain, const char **name,
enum lsa_SidType *name_type);
bool winbind_ping(void);
-bool winbind_sid_to_uid(uid_t *puid, const DOM_SID *sid);
-bool winbind_uid_to_sid(DOM_SID *sid, uid_t uid);
-bool winbind_sid_to_gid(gid_t *pgid, const DOM_SID *sid);
-bool winbind_gid_to_sid(DOM_SID *sid, gid_t gid);
+bool winbind_sid_to_uid(uid_t *puid, const struct dom_sid *sid);
+bool winbind_uid_to_sid(struct dom_sid *sid, uid_t uid);
+bool winbind_sid_to_gid(gid_t *pgid, const struct dom_sid *sid);
+bool winbind_gid_to_sid(struct dom_sid *sid, gid_t gid);
struct passwd * winbind_getpwnam(const char * sname);
-struct passwd * winbind_getpwsid(const DOM_SID *sid);
+struct passwd * winbind_getpwsid(const struct dom_sid *sid);
wbcErr wb_is_trusted_domain(const char *domain);
bool winbind_lookup_rids(TALLOC_CTX *mem_ctx,
- const DOM_SID *domain_sid,
+ const struct dom_sid *domain_sid,
int num_rids, uint32 *rids,
const char **domain_name,
const char ***names, enum lsa_SidType **types);
uint32_t *num_groups,
gid_t ** _groups);
bool winbind_get_sid_aliases(TALLOC_CTX *mem_ctx,
- const DOM_SID *dom_sid,
- const DOM_SID *members,
+ const struct dom_sid *dom_sid,
+ const struct dom_sid *members,
size_t num_members,
uint32_t **pp_alias_rids,
size_t *p_num_alias_rids);
ADS_STATUS ads_USN(ADS_STRUCT *ads, uint32 *usn);
ADS_STATUS ads_current_time(ADS_STRUCT *ads);
ADS_STATUS ads_domain_func_level(ADS_STRUCT *ads, uint32 *val);
-ADS_STATUS ads_domain_sid(ADS_STRUCT *ads, DOM_SID *sid);
+ADS_STATUS ads_domain_sid(ADS_STRUCT *ads, struct dom_sid *sid);
ADS_STATUS ads_site_dn(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, const char **site_name);
ADS_STATUS ads_site_dn_for_machine(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, const char *computer_name, const char **site_dn);
ADS_STATUS ads_upn_suffixes(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, char ***suffixes, size_t *num_suffixes);
ADS_STATUS ads_get_sid_from_extended_dn(TALLOC_CTX *mem_ctx,
const char *extended_dn,
enum ads_extended_dn_flags flags,
- DOM_SID *sid);
+ struct dom_sid *sid);
char* ads_get_dnshostname( ADS_STRUCT *ads, TALLOC_CTX *ctx, const char *machine_name );
char* ads_get_upn( ADS_STRUCT *ads, TALLOC_CTX *ctx, const char *machine_name );
char* ads_get_samaccountname( ADS_STRUCT *ads, TALLOC_CTX *ctx, const char *machine_name );
struct messaging_context *msg_ctx,
struct sockaddr_storage *dc_ss,
const char *domain_name,
- const DOM_SID *sid,
+ const struct dom_sid *sid,
uint32_t nt_version);
bool receive_getdc_response(TALLOC_CTX *mem_ctx,
struct sockaddr_storage *dc_ss,
bool cli_list_user_quota(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_LIST **pqt_list);
bool cli_get_fs_quota_info(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_STRUCT *pqt);
bool cli_set_fs_quota_info(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_STRUCT *pqt);
-void dump_ntquota(SMB_NTQUOTA_STRUCT *qt, bool _verbose, bool _numeric, void (*_sidtostring)(fstring str, DOM_SID *sid, bool _numeric));
-void dump_ntquota_list(SMB_NTQUOTA_LIST **qtl, bool _verbose, bool _numeric, void (*_sidtostring)(fstring str, DOM_SID *sid, bool _numeric));
+void dump_ntquota(SMB_NTQUOTA_STRUCT *qt, bool _verbose, bool _numeric, void (*_sidtostring)(fstring str, struct dom_sid *sid, bool _numeric));
+void dump_ntquota_list(SMB_NTQUOTA_LIST **qtl, bool _verbose, bool _numeric, void (*_sidtostring)(fstring str, struct dom_sid *sid, bool _numeric));
/* The following definitions come from libsmb/clirap.c */
bool netsamlogon_cache_shutdown(void);
void netsamlogon_clear_cached_user(struct netr_SamInfo3 *info3);
bool netsamlogon_cache_store(const char *username, struct netr_SamInfo3 *info3);
-struct netr_SamInfo3 *netsamlogon_cache_get(TALLOC_CTX *mem_ctx, const DOM_SID *user_sid);
-bool netsamlogon_cache_have(const DOM_SID *user_sid);
+struct netr_SamInfo3 *netsamlogon_cache_get(TALLOC_CTX *mem_ctx, const struct dom_sid *user_sid);
+bool netsamlogon_cache_have(const struct dom_sid *user_sid);
/* The following definitions come from libsmb/smb_seal.c */
bool trustdom_cache_enable(void);
bool trustdom_cache_shutdown(void);
-bool trustdom_cache_store(char* name, char* alt_name, const DOM_SID *sid,
+bool trustdom_cache_store(char* name, char* alt_name, const struct dom_sid *sid,
time_t timeout);
-bool trustdom_cache_fetch(const char* name, DOM_SID* sid);
+bool trustdom_cache_fetch(const char* name, struct dom_sid* sid);
uint32 trustdom_cache_fetch_timestamp( void );
bool trustdom_cache_store_timestamp( uint32 t, time_t timeout );
void trustdom_cache_flush(void);
const char *domain) ;
bool enumerate_domain_trusts( TALLOC_CTX *mem_ctx, const char *domain,
char ***domain_names, uint32 *num_domains,
- DOM_SID **sids );
+ struct dom_sid **sids );
/* The following definitions come from libsmb/unexpected.c */
bool lookup_name(TALLOC_CTX *mem_ctx,
const char *full_name, int flags,
const char **ret_domain, const char **ret_name,
- DOM_SID *ret_sid, enum lsa_SidType *ret_type);
+ struct dom_sid *ret_sid, enum lsa_SidType *ret_type);
bool lookup_name_smbconf(TALLOC_CTX *mem_ctx,
const char *full_name, int flags,
const char **ret_domain, const char **ret_name,
- DOM_SID *ret_sid, enum lsa_SidType *ret_type);
+ struct dom_sid *ret_sid, enum lsa_SidType *ret_type);
NTSTATUS lookup_sids(TALLOC_CTX *mem_ctx, int num_sids,
- const DOM_SID **sids, int level,
+ const struct dom_sid **sids, int level,
struct lsa_dom_info **ret_domains,
struct lsa_name_info **ret_names);
-bool lookup_sid(TALLOC_CTX *mem_ctx, const DOM_SID *sid,
+bool lookup_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
const char **ret_domain, const char **ret_name,
enum lsa_SidType *ret_type);
-void store_uid_sid_cache(const DOM_SID *psid, uid_t uid);
-void store_gid_sid_cache(const DOM_SID *psid, gid_t gid);
-void uid_to_sid(DOM_SID *psid, uid_t uid);
-void gid_to_sid(DOM_SID *psid, gid_t gid);
-bool sid_to_uid(const DOM_SID *psid, uid_t *puid);
-bool sid_to_gid(const DOM_SID *psid, gid_t *pgid);
+void store_uid_sid_cache(const struct dom_sid *psid, uid_t uid);
+void store_gid_sid_cache(const struct dom_sid *psid, gid_t gid);
+void uid_to_sid(struct dom_sid *psid, uid_t uid);
+void gid_to_sid(struct dom_sid *psid, gid_t gid);
+bool sid_to_uid(const struct dom_sid *psid, uid_t *puid);
+bool sid_to_gid(const struct dom_sid *psid, gid_t *pgid);
/* The following definitions come from passdb/machine_sid.c */
const uint8_t *pdb_get_lanman_passwd(const struct samu *sampass);
const uint8_t *pdb_get_pw_history(const struct samu *sampass, uint32_t *current_hist_len);
const char *pdb_get_plaintext_passwd(const struct samu *sampass);
-const DOM_SID *pdb_get_user_sid(const struct samu *sampass);
-const DOM_SID *pdb_get_group_sid(struct samu *sampass);
+const struct dom_sid *pdb_get_user_sid(const struct samu *sampass);
+const struct dom_sid *pdb_get_group_sid(struct samu *sampass);
enum pdb_value_state pdb_get_init_flags(const struct samu *sampass, enum pdb_elements element);
const char *pdb_get_username(const struct samu *sampass);
const char *pdb_get_domain(const struct samu *sampass);
bool pdb_set_hours_len(struct samu *sampass, uint32_t len, enum pdb_value_state flag);
bool pdb_set_logon_divs(struct samu *sampass, uint16_t hours, enum pdb_value_state flag);
bool pdb_set_init_flags(struct samu *sampass, enum pdb_elements element, enum pdb_value_state value_flag);
-bool pdb_set_user_sid(struct samu *sampass, const DOM_SID *u_sid, enum pdb_value_state flag);
+bool pdb_set_user_sid(struct samu *sampass, const struct dom_sid *u_sid, enum pdb_value_state flag);
bool pdb_set_user_sid_from_string(struct samu *sampass, fstring u_sid, enum pdb_value_state flag);
-bool pdb_set_group_sid(struct samu *sampass, const DOM_SID *g_sid, enum pdb_value_state flag);
+bool pdb_set_group_sid(struct samu *sampass, const struct dom_sid *g_sid, enum pdb_value_state flag);
bool pdb_set_username(struct samu *sampass, const char *username, enum pdb_value_state flag);
bool pdb_set_domain(struct samu *sampass, const char *domain, enum pdb_value_state flag);
bool pdb_set_nt_username(struct samu *sampass, const char *nt_username, enum pdb_value_state flag);
NTSTATUS make_pdb_method_name(struct pdb_methods **methods, const char *selected);
struct pdb_domain_info *pdb_get_domain_info(TALLOC_CTX *mem_ctx);
bool pdb_getsampwnam(struct samu *sam_acct, const char *username) ;
-bool pdb_getsampwsid(struct samu *sam_acct, const DOM_SID *sid) ;
+bool pdb_getsampwsid(struct samu *sam_acct, const struct dom_sid *sid) ;
NTSTATUS pdb_create_user(TALLOC_CTX *mem_ctx, const char *name, uint32_t flags,
uint32_t *rid);
NTSTATUS pdb_delete_user(TALLOC_CTX *mem_ctx, struct samu *sam_acct);
NTSTATUS pdb_delete_sam_account(struct samu *sam_acct) ;
NTSTATUS pdb_rename_sam_account(struct samu *oldname, const char *newname);
NTSTATUS pdb_update_login_attempts(struct samu *sam_acct, bool success);
-bool pdb_getgrsid(GROUP_MAP *map, DOM_SID sid);
+bool pdb_getgrsid(GROUP_MAP *map, struct dom_sid sid);
bool pdb_getgrgid(GROUP_MAP *map, gid_t gid);
bool pdb_getgrnam(GROUP_MAP *map, const char *name);
NTSTATUS pdb_create_dom_group(TALLOC_CTX *mem_ctx, const char *name,
NTSTATUS pdb_delete_dom_group(TALLOC_CTX *mem_ctx, uint32_t rid);
NTSTATUS pdb_add_group_mapping_entry(GROUP_MAP *map);
NTSTATUS pdb_update_group_mapping_entry(GROUP_MAP *map);
-NTSTATUS pdb_delete_group_mapping_entry(DOM_SID sid);
-bool pdb_enum_group_mapping(const DOM_SID *sid, enum lsa_SidType sid_name_use, GROUP_MAP **pp_rmap,
+NTSTATUS pdb_delete_group_mapping_entry(struct dom_sid sid);
+bool pdb_enum_group_mapping(const struct dom_sid *sid, enum lsa_SidType sid_name_use, GROUP_MAP **pp_rmap,
size_t *p_num_entries, bool unix_only);
NTSTATUS pdb_enum_group_members(TALLOC_CTX *mem_ctx,
- const DOM_SID *sid,
+ const struct dom_sid *sid,
uint32_t **pp_member_rids,
size_t *p_num_members);
NTSTATUS pdb_enum_group_memberships(TALLOC_CTX *mem_ctx, struct samu *user,
- DOM_SID **pp_sids, gid_t **pp_gids,
+ struct dom_sid **pp_sids, gid_t **pp_gids,
size_t *p_num_groups);
NTSTATUS pdb_set_unix_primary_group(TALLOC_CTX *mem_ctx, struct samu *user);
NTSTATUS pdb_add_groupmem(TALLOC_CTX *mem_ctx, uint32_t group_rid,
NTSTATUS pdb_del_groupmem(TALLOC_CTX *mem_ctx, uint32_t group_rid,
uint32_t member_rid);
NTSTATUS pdb_create_alias(const char *name, uint32_t *rid);
-NTSTATUS pdb_delete_alias(const DOM_SID *sid);
-NTSTATUS pdb_get_aliasinfo(const DOM_SID *sid, struct acct_info *info);
-NTSTATUS pdb_set_aliasinfo(const DOM_SID *sid, struct acct_info *info);
-NTSTATUS pdb_add_aliasmem(const DOM_SID *alias, const DOM_SID *member);
-NTSTATUS pdb_del_aliasmem(const DOM_SID *alias, const DOM_SID *member);
-NTSTATUS pdb_enum_aliasmem(const DOM_SID *alias, TALLOC_CTX *mem_ctx,
- DOM_SID **pp_members, size_t *p_num_members);
+NTSTATUS pdb_delete_alias(const struct dom_sid *sid);
+NTSTATUS pdb_get_aliasinfo(const struct dom_sid *sid, struct acct_info *info);
+NTSTATUS pdb_set_aliasinfo(const struct dom_sid *sid, struct acct_info *info);
+NTSTATUS pdb_add_aliasmem(const struct dom_sid *alias, const struct dom_sid *member);
+NTSTATUS pdb_del_aliasmem(const struct dom_sid *alias, const struct dom_sid *member);
+NTSTATUS pdb_enum_aliasmem(const struct dom_sid *alias, TALLOC_CTX *mem_ctx,
+ struct dom_sid **pp_members, size_t *p_num_members);
NTSTATUS pdb_enum_alias_memberships(TALLOC_CTX *mem_ctx,
- const DOM_SID *domain_sid,
- const DOM_SID *members, size_t num_members,
+ const struct dom_sid *domain_sid,
+ const struct dom_sid *members, size_t num_members,
uint32_t **pp_alias_rids,
size_t *p_num_alias_rids);
-NTSTATUS pdb_lookup_rids(const DOM_SID *domain_sid,
+NTSTATUS pdb_lookup_rids(const struct dom_sid *domain_sid,
int num_rids,
uint32_t *rids,
const char **names,
enum lsa_SidType *attrs);
-NTSTATUS pdb_lookup_names(const DOM_SID *domain_sid,
+NTSTATUS pdb_lookup_names(const struct dom_sid *domain_sid,
int num_names,
const char **names,
uint32_t *rids,
bool pdb_get_account_policy(enum pdb_policy_type type, uint32_t *value);
bool pdb_set_account_policy(enum pdb_policy_type type, uint32_t value);
bool pdb_get_seq_num(time_t *seq_num);
-bool pdb_uid_to_sid(uid_t uid, DOM_SID *sid);
-bool pdb_gid_to_sid(gid_t gid, DOM_SID *sid);
-bool pdb_sid_to_id(const DOM_SID *sid, union unid_t *id,
+bool pdb_uid_to_sid(uid_t uid, struct dom_sid *sid);
+bool pdb_gid_to_sid(gid_t gid, struct dom_sid *sid);
+bool pdb_sid_to_id(const struct dom_sid *sid, union unid_t *id,
enum lsa_SidType *type);
uint32_t pdb_capabilities(void);
bool pdb_new_rid(uint32_t *rid);
enum pdb_search_type type);
struct pdb_search *pdb_search_users(TALLOC_CTX *mem_ctx, uint32_t acct_flags);
struct pdb_search *pdb_search_groups(TALLOC_CTX *mem_ctx);
-struct pdb_search *pdb_search_aliases(TALLOC_CTX *mem_ctx, const DOM_SID *sid);
+struct pdb_search *pdb_search_aliases(TALLOC_CTX *mem_ctx, const struct dom_sid *sid);
uint32_t pdb_search_entries(struct pdb_search *search,
uint32_t start_idx, uint32_t max_entries,
struct samr_displayentry **result);
-bool pdb_get_trusteddom_pw(const char *domain, char** pwd, DOM_SID *sid,
+bool pdb_get_trusteddom_pw(const char *domain, char** pwd, struct dom_sid *sid,
time_t *pass_last_set_time);
bool pdb_set_trusteddom_pw(const char* domain, const char* pwd,
- const DOM_SID *sid);
+ const struct dom_sid *sid);
bool pdb_del_trusteddom_pw(const char *domain);
NTSTATUS pdb_enum_trusteddoms(TALLOC_CTX *mem_ctx, uint32_t *num_domains,
struct trustdom_info ***domains);
bool lookup_builtin_rid(TALLOC_CTX *mem_ctx, uint32 rid, const char **name);
bool lookup_builtin_name(const char *name, uint32 *rid);
const char *builtin_domain_name(void);
-bool sid_check_is_builtin(const DOM_SID *sid);
-bool sid_check_is_in_builtin(const DOM_SID *sid);
+bool sid_check_is_builtin(const struct dom_sid *sid);
+bool sid_check_is_in_builtin(const struct dom_sid *sid);
/* The following definitions come from passdb/util_unixsids.c */
-bool sid_check_is_unix_users(const DOM_SID *sid);
-bool sid_check_is_in_unix_users(const DOM_SID *sid);
-bool uid_to_unix_users_sid(uid_t uid, DOM_SID *sid);
-bool gid_to_unix_groups_sid(gid_t gid, DOM_SID *sid);
+bool sid_check_is_unix_users(const struct dom_sid *sid);
+bool sid_check_is_in_unix_users(const struct dom_sid *sid);
+bool uid_to_unix_users_sid(uid_t uid, struct dom_sid *sid);
+bool gid_to_unix_groups_sid(gid_t gid, struct dom_sid *sid);
const char *unix_users_domain_name(void);
-bool lookup_unix_user_name(const char *name, DOM_SID *sid);
-bool sid_check_is_unix_groups(const DOM_SID *sid);
-bool sid_check_is_in_unix_groups(const DOM_SID *sid);
+bool lookup_unix_user_name(const char *name, struct dom_sid *sid);
+bool sid_check_is_unix_groups(const struct dom_sid *sid);
+bool sid_check_is_in_unix_groups(const struct dom_sid *sid);
const char *unix_groups_domain_name(void);
-bool lookup_unix_group_name(const char *name, DOM_SID *sid);
+bool lookup_unix_group_name(const char *name, struct dom_sid *sid);
/* The following definitions come from passdb/util_wellknown.c */
-bool sid_check_is_wellknown_domain(const DOM_SID *sid, const char **name);
-bool sid_check_is_in_wellknown_domain(const DOM_SID *sid);
-bool lookup_wellknown_sid(TALLOC_CTX *mem_ctx, const DOM_SID *sid,
+bool sid_check_is_wellknown_domain(const struct dom_sid *sid, const char **name);
+bool sid_check_is_in_wellknown_domain(const struct dom_sid *sid);
+bool lookup_wellknown_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
const char **domain, const char **name);
bool lookup_wellknown_name(TALLOC_CTX *mem_ctx, const char *name,
- DOM_SID *sid, const char **domain);
+ struct dom_sid *sid, const char **domain);
/* The following definitions come from printing/load.c */
/* The following definitions come from smbd/ntquotas.c */
-int vfs_get_ntquota(files_struct *fsp, enum SMB_QUOTA_TYPE qtype, DOM_SID *psid, SMB_NTQUOTA_STRUCT *qt);
-int vfs_set_ntquota(files_struct *fsp, enum SMB_QUOTA_TYPE qtype, DOM_SID *psid, SMB_NTQUOTA_STRUCT *qt);
+int vfs_get_ntquota(files_struct *fsp, enum SMB_QUOTA_TYPE qtype, struct dom_sid *psid, SMB_NTQUOTA_STRUCT *qt);
+int vfs_set_ntquota(files_struct *fsp, enum SMB_QUOTA_TYPE qtype, struct dom_sid *psid, SMB_NTQUOTA_STRUCT *qt);
int vfs_get_user_ntquota_list(files_struct *fsp, SMB_NTQUOTA_LIST **qt_list);
void *init_quota_handle(TALLOC_CTX *mem_ctx);
/* The following definitions come from smbd/posix_acls.c */
-void create_file_sids(const SMB_STRUCT_STAT *psbuf, DOM_SID *powner_sid, DOM_SID *pgroup_sid);
+void create_file_sids(const SMB_STRUCT_STAT *psbuf, struct dom_sid *powner_sid, struct dom_sid *pgroup_sid);
bool nt4_compatible_acls(void);
uint32_t map_canon_ace_perms(int snum,
enum security_ace_type *pacl_type,
/* The following definitions come from winbindd/idmap_util.c */
-NTSTATUS idmap_uid_to_sid(const char *domname, DOM_SID *sid, uid_t uid);
-NTSTATUS idmap_gid_to_sid(const char *domname, DOM_SID *sid, gid_t gid);
-NTSTATUS idmap_sid_to_uid(const char *dom_name, DOM_SID *sid, uid_t *uid);
-NTSTATUS idmap_sid_to_gid(const char *domname, DOM_SID *sid, gid_t *gid);
+NTSTATUS idmap_uid_to_sid(const char *domname, struct dom_sid *sid, uid_t uid);
+NTSTATUS idmap_gid_to_sid(const char *domname, struct dom_sid *sid, gid_t gid);
+NTSTATUS idmap_sid_to_uid(const char *dom_name, struct dom_sid *sid, uid_t *uid);
+NTSTATUS idmap_sid_to_gid(const char *domname, struct dom_sid *sid, gid_t *gid);
/* The following definitions come from winbindd/nss_info.c */
*/
struct trustdom_info {
char *name;
- DOM_SID sid;
+ struct dom_sid sid;
};
/*
|LOOKUP_NAME_WKN\
|LOOKUP_NAME_DOMAIN)
-/**
- * @brief Security Identifier
- *
- * @sa http://msdn.microsoft.com/library/default.asp?url=/library/en-us/security/accctrl_38yn.asp
- **/
-typedef struct dom_sid DOM_SID;
-
enum id_mapping {
ID_UNKNOWN = 0,
ID_MAPPED,
};
struct id_map {
- DOM_SID *sid;
+ struct dom_sid *sid;
struct unixid xid;
enum id_mapping status;
};
struct lsa_dom_info {
bool valid;
- DOM_SID sid;
+ struct dom_sid sid;
const char *name;
int num_idxs;
int *idxs;
};
/* Some well-known SIDs */
-extern const DOM_SID global_sid_World_Domain;
-extern const DOM_SID global_sid_World;
-extern const DOM_SID global_sid_Creator_Owner_Domain;
-extern const DOM_SID global_sid_NT_Authority;
-extern const DOM_SID global_sid_System;
-extern const DOM_SID global_sid_NULL;
-extern const DOM_SID global_sid_Authenticated_Users;
-extern const DOM_SID global_sid_Network;
-extern const DOM_SID global_sid_Creator_Owner;
-extern const DOM_SID global_sid_Creator_Group;
-extern const DOM_SID global_sid_Anonymous;
-extern const DOM_SID global_sid_Builtin;
-extern const DOM_SID global_sid_Builtin_Administrators;
-extern const DOM_SID global_sid_Builtin_Users;
-extern const DOM_SID global_sid_Builtin_Guests;
-extern const DOM_SID global_sid_Builtin_Power_Users;
-extern const DOM_SID global_sid_Builtin_Account_Operators;
-extern const DOM_SID global_sid_Builtin_Server_Operators;
-extern const DOM_SID global_sid_Builtin_Print_Operators;
-extern const DOM_SID global_sid_Builtin_Backup_Operators;
-extern const DOM_SID global_sid_Builtin_Replicator;
-extern const DOM_SID global_sid_Builtin_PreWin2kAccess;
-extern const DOM_SID global_sid_Unix_Users;
-extern const DOM_SID global_sid_Unix_Groups;
+extern const struct dom_sid global_sid_World_Domain;
+extern const struct dom_sid global_sid_World;
+extern const struct dom_sid global_sid_Creator_Owner_Domain;
+extern const struct dom_sid global_sid_NT_Authority;
+extern const struct dom_sid global_sid_System;
+extern const struct dom_sid global_sid_NULL;
+extern const struct dom_sid global_sid_Authenticated_Users;
+extern const struct dom_sid global_sid_Network;
+extern const struct dom_sid global_sid_Creator_Owner;
+extern const struct dom_sid global_sid_Creator_Group;
+extern const struct dom_sid global_sid_Anonymous;
+extern const struct dom_sid global_sid_Builtin;
+extern const struct dom_sid global_sid_Builtin_Administrators;
+extern const struct dom_sid global_sid_Builtin_Users;
+extern const struct dom_sid global_sid_Builtin_Guests;
+extern const struct dom_sid global_sid_Builtin_Power_Users;
+extern const struct dom_sid global_sid_Builtin_Account_Operators;
+extern const struct dom_sid global_sid_Builtin_Server_Operators;
+extern const struct dom_sid global_sid_Builtin_Print_Operators;
+extern const struct dom_sid global_sid_Builtin_Backup_Operators;
+extern const struct dom_sid global_sid_Builtin_Replicator;
+extern const struct dom_sid global_sid_Builtin_PreWin2kAccess;
+extern const struct dom_sid global_sid_Unix_Users;
+extern const struct dom_sid global_sid_Unix_Groups;
/*
* The complete list of SIDS belonging to this user.
typedef struct nt_user_token {
size_t num_sids;
- DOM_SID *user_sids;
+ struct dom_sid *user_sids;
SE_PRIV privileges;
} NT_USER_TOKEN;
int index;
const char *domain_name;
- DOM_SID domain_sid;
+ struct dom_sid domain_sid;
/* configuration items */
int schema_ver;
4 bytes - pad / reserved (must be zero)
8 bytes unsigned[] - list of GIDs (may be empty)
- DOM_SID[] - list of SIDs (may be empty)
+ struct dom_sid[] - list of SIDs (may be empty)
*/
/*
char *cell = NULL;
bool result;
char *ticket_str = NULL;
- const DOM_SID *user_sid;
+ const struct dom_sid *user_sid;
TALLOC_CTX *ctx = talloc_tos();
struct ClearToken ct;
status = rpccli_samr_OpenDomain(pipe_cli, mem_ctx,
connect_handle,
builtin_mask,
- CONST_DISCARD(DOM_SID *, &global_sid_Builtin),
+ CONST_DISCARD(struct dom_sid *, &global_sid_Builtin),
builtin_handle);
if (!NT_STATUS_IS_OK(status)) {
werr = ntstatus_to_werror(status);
status = rpccli_samr_OpenDomain(pipe_cli, ctx,
&connect_handle,
SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT,
- CONST_DISCARD(DOM_SID *, &global_sid_Builtin),
+ CONST_DISCARD(struct dom_sid *, &global_sid_Builtin),
&builtin_handle);
if (!NT_STATUS_IS_OK(status)) {
werr = ntstatus_to_werror(status);
typedef struct {
size_t count;
- DOM_SID *list;
+ struct dom_sid *list;
} SID_LIST;
typedef struct {
} PRIV_SID_LIST;
-static bool get_privileges( const DOM_SID *sid, SE_PRIV *mask )
+static bool get_privileges( const struct dom_sid *sid, SE_PRIV *mask )
{
struct db_context *db = get_account_pol_db();
fstring tmp, keystr;
Store the privilege mask (set) for a given SID
****************************************************************************/
-static bool set_privileges( const DOM_SID *sid, SE_PRIV *mask )
+static bool set_privileges( const struct dom_sid *sid, SE_PRIV *mask )
{
struct db_context *db = get_account_pol_db();
fstring tmp, keystr;
get a list of all privileges for all sids in the list
*********************************************************************/
-bool get_privileges_for_sids(SE_PRIV *privileges, DOM_SID *slist, int scount)
+bool get_privileges_for_sids(SE_PRIV *privileges, struct dom_sid *slist, int scount)
{
SE_PRIV mask;
int i;
{
PRIV_SID_LIST *priv = (PRIV_SID_LIST *)state;
int prefixlen = strlen(PRIVPREFIX);
- DOM_SID sid;
+ struct dom_sid sid;
fstring sid_string;
/* easy check first */
Retreive list of privileged SIDs (for _lsa_enumerate_accounts()
*********************************************************************/
-NTSTATUS privilege_enumerate_accounts(DOM_SID **sids, int *num_sids)
+NTSTATUS privilege_enumerate_accounts(struct dom_sid **sids, int *num_sids)
{
struct db_context *db = get_account_pol_db();
PRIV_SID_LIST priv;
*********************************************************************/
NTSTATUS privilege_enum_sids(const SE_PRIV *mask, TALLOC_CTX *mem_ctx,
- DOM_SID **sids, int *num_sids)
+ struct dom_sid **sids, int *num_sids)
{
struct db_context *db = get_account_pol_db();
PRIV_SID_LIST priv;
Add privilege to sid
****************************************************************************/
-bool grant_privilege(const DOM_SID *sid, const SE_PRIV *priv_mask)
+bool grant_privilege(const struct dom_sid *sid, const SE_PRIV *priv_mask)
{
SE_PRIV old_mask, new_mask;
Add a privilege based on its name
*********************************************************************/
-bool grant_privilege_by_name(DOM_SID *sid, const char *name)
+bool grant_privilege_by_name(struct dom_sid *sid, const char *name)
{
SE_PRIV mask;
Remove privilege from sid
****************************************************************************/
-bool revoke_privilege(const DOM_SID *sid, const SE_PRIV *priv_mask)
+bool revoke_privilege(const struct dom_sid *sid, const SE_PRIV *priv_mask)
{
SE_PRIV mask;
Revoke all privileges
*********************************************************************/
-bool revoke_all_privileges( DOM_SID *sid )
+bool revoke_all_privileges( struct dom_sid *sid )
{
return revoke_privilege( sid, &se_priv_all );
}
Add a privilege based on its name
*********************************************************************/
-bool revoke_privilege_by_name(DOM_SID *sid, const char *name)
+bool revoke_privilege_by_name(struct dom_sid *sid, const char *name)
{
SE_PRIV mask;
Retrieve the SIDs assigned to a given privilege
****************************************************************************/
-NTSTATUS privilege_create_account(const DOM_SID *sid )
+NTSTATUS privilege_create_account(const struct dom_sid *sid )
{
return ( grant_privilege(sid, &se_priv_none) ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL);
}
/*******************************************************************
*******************************************************************/
-bool is_privileged_sid( const DOM_SID *sid )
+bool is_privileged_sid( const struct dom_sid *sid )
{
SE_PRIV mask;
/*******************************************************************
*******************************************************************/
-bool grant_all_privileges( const DOM_SID *sid )
+bool grant_all_privileges( const struct dom_sid *sid )
{
SE_PRIV mask;
struct sec_desc_buf *sec_desc_merge_buf(TALLOC_CTX *ctx, struct sec_desc_buf *new_sdb, struct sec_desc_buf *old_sdb)
{
- DOM_SID *owner_sid, *group_sid;
+ struct dom_sid *owner_sid, *group_sid;
struct sec_desc_buf *return_sdb;
struct security_acl *dacl, *sacl;
struct security_descriptor *psd = NULL;
struct security_descriptor *sec_desc_merge(TALLOC_CTX *ctx, struct security_descriptor *new_sdb, struct security_descriptor *old_sdb)
{
- DOM_SID *owner_sid, *group_sid;
+ struct dom_sid *owner_sid, *group_sid;
struct security_acl *dacl, *sacl;
struct security_descriptor *psd = NULL;
uint16 secdesc_type;
struct security_descriptor *make_sec_desc(TALLOC_CTX *ctx,
enum security_descriptor_revision revision,
uint16 type,
- const DOM_SID *owner_sid, const DOM_SID *grp_sid,
+ const struct dom_sid *owner_sid, const struct dom_sid *grp_sid,
struct security_acl *sacl, struct security_acl *dacl, size_t *sd_size)
{
struct security_descriptor *dst;
Creates a struct security_descriptor structure with typical defaults.
********************************************************************/
-struct security_descriptor *make_standard_sec_desc(TALLOC_CTX *ctx, const DOM_SID *owner_sid, const DOM_SID *grp_sid,
+struct security_descriptor *make_standard_sec_desc(TALLOC_CTX *ctx, const struct dom_sid *owner_sid, const struct dom_sid *grp_sid,
struct security_acl *dacl, size_t *sd_size)
{
return make_sec_desc(ctx, SECURITY_DESCRIPTOR_REVISION_1,
Add a new SID with its permissions to struct security_descriptor.
********************************************************************/
-NTSTATUS sec_desc_add_sid(TALLOC_CTX *ctx, struct security_descriptor **psd, DOM_SID *sid, uint32 mask, size_t *sd_size)
+NTSTATUS sec_desc_add_sid(TALLOC_CTX *ctx, struct security_descriptor **psd, struct dom_sid *sid, uint32 mask, size_t *sd_size)
{
struct security_descriptor *sd = 0;
struct security_acl *dacl = 0;
Modify a SID's permissions in a struct security_descriptor.
********************************************************************/
-NTSTATUS sec_desc_mod_sid(struct security_descriptor *sd, DOM_SID *sid, uint32 mask)
+NTSTATUS sec_desc_mod_sid(struct security_descriptor *sd, struct dom_sid *sid, uint32 mask)
{
NTSTATUS status;
Delete a SID from a struct security_descriptor.
********************************************************************/
-NTSTATUS sec_desc_del_sid(TALLOC_CTX *ctx, struct security_descriptor **psd, DOM_SID *sid, size_t *sd_size)
+NTSTATUS sec_desc_del_sid(TALLOC_CTX *ctx, struct security_descriptor **psd, struct dom_sid *sid, size_t *sd_size)
{
struct security_descriptor *sd = 0;
struct security_acl *dacl = 0;
struct security_descriptor **ppsd,
size_t *psize,
const struct security_descriptor *parent_ctr,
- const DOM_SID *owner_sid,
- const DOM_SID *group_sid,
+ const struct dom_sid *owner_sid,
+ const struct dom_sid *group_sid,
bool container)
{
struct security_acl *new_dacl = NULL, *the_acl = NULL;
for (i = 0; i < the_acl->num_aces; i++) {
const struct security_ace *ace = &the_acl->aces[i];
struct security_ace *new_ace = &new_ace_list[new_ace_list_ndx];
- const DOM_SID *ptrustee = &ace->trustee;
- const DOM_SID *creator = NULL;
+ const struct dom_sid *ptrustee = &ace->trustee;
+ const struct dom_sid *creator = NULL;
uint8 new_flags = ace->flags;
if (!is_inheritable_ace(ace, container)) {
uint32_t sa;
uint32 g_access;
uint32 s_access;
- DOM_SID sid;
+ struct dom_sid sid;
char *sidstr;
enum security_ace_type type = SEC_ACE_TYPE_ACCESS_ALLOWED;
static char *longvar_domainsid( void )
{
- DOM_SID sid;
+ struct dom_sid sid;
fstring tmp;
char *sid_string;
}
if (ptoken->user_sids && ptoken->num_sids) {
- token->user_sids = (DOM_SID *)talloc_memdup(
- token, ptoken->user_sids, sizeof(DOM_SID) * ptoken->num_sids );
+ token->user_sids = (struct dom_sid *)talloc_memdup(
+ token, ptoken->user_sids, sizeof(struct dom_sid) * ptoken->num_sids );
if (token->user_sids == NULL) {
DEBUG(0, ("talloc_memdup failed\n"));
*/
-const DOM_SID global_sid_World_Domain = /* Everyone domain */
+const struct dom_sid global_sid_World_Domain = /* Everyone domain */
{ 1, 0, {0,0,0,0,0,1}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}};
-const DOM_SID global_sid_World = /* Everyone */
+const struct dom_sid global_sid_World = /* Everyone */
{ 1, 1, {0,0,0,0,0,1}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}};
-const DOM_SID global_sid_Creator_Owner_Domain = /* Creator Owner domain */
+const struct dom_sid global_sid_Creator_Owner_Domain = /* Creator Owner domain */
{ 1, 0, {0,0,0,0,0,3}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}};
-const DOM_SID global_sid_NT_Authority = /* NT Authority */
+const struct dom_sid global_sid_NT_Authority = /* NT Authority */
{ 1, 0, {0,0,0,0,0,5}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}};
-const DOM_SID global_sid_System = /* System */
+const struct dom_sid global_sid_System = /* System */
{ 1, 1, {0,0,0,0,0,5}, {18,0,0,0,0,0,0,0,0,0,0,0,0,0,0}};
-const DOM_SID global_sid_NULL = /* NULL sid */
+const struct dom_sid global_sid_NULL = /* NULL sid */
{ 1, 1, {0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}};
-const DOM_SID global_sid_Authenticated_Users = /* All authenticated rids */
+const struct dom_sid global_sid_Authenticated_Users = /* All authenticated rids */
{ 1, 1, {0,0,0,0,0,5}, {11,0,0,0,0,0,0,0,0,0,0,0,0,0,0}};
#if 0
/* for documentation */
-const DOM_SID global_sid_Restriced = /* Restriced Code */
+const struct dom_sid global_sid_Restriced = /* Restriced Code */
{ 1, 1, {0,0,0,0,0,5}, {12,0,0,0,0,0,0,0,0,0,0,0,0,0,0}};
#endif
-const DOM_SID global_sid_Network = /* Network rids */
+const struct dom_sid global_sid_Network = /* Network rids */
{ 1, 1, {0,0,0,0,0,5}, {2,0,0,0,0,0,0,0,0,0,0,0,0,0,0}};
-const DOM_SID global_sid_Creator_Owner = /* Creator Owner */
+const struct dom_sid global_sid_Creator_Owner = /* Creator Owner */
{ 1, 1, {0,0,0,0,0,3}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}};
-const DOM_SID global_sid_Creator_Group = /* Creator Group */
+const struct dom_sid global_sid_Creator_Group = /* Creator Group */
{ 1, 1, {0,0,0,0,0,3}, {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0}};
-const DOM_SID global_sid_Anonymous = /* Anonymous login */
+const struct dom_sid global_sid_Anonymous = /* Anonymous login */
{ 1, 1, {0,0,0,0,0,5}, {7,0,0,0,0,0,0,0,0,0,0,0,0,0,0}};
-const DOM_SID global_sid_Builtin = /* Local well-known domain */
+const struct dom_sid global_sid_Builtin = /* Local well-known domain */
{ 1, 1, {0,0,0,0,0,5}, {32,0,0,0,0,0,0,0,0,0,0,0,0,0,0}};
-const DOM_SID global_sid_Builtin_Administrators = /* Builtin administrators */
+const struct dom_sid global_sid_Builtin_Administrators = /* Builtin administrators */
{ 1, 2, {0,0,0,0,0,5}, {32,544,0,0,0,0,0,0,0,0,0,0,0,0,0}};
-const DOM_SID global_sid_Builtin_Users = /* Builtin users */
+const struct dom_sid global_sid_Builtin_Users = /* Builtin users */
{ 1, 2, {0,0,0,0,0,5}, {32,545,0,0,0,0,0,0,0,0,0,0,0,0,0}};
-const DOM_SID global_sid_Builtin_Guests = /* Builtin guest users */
+const struct dom_sid global_sid_Builtin_Guests = /* Builtin guest users */
{ 1, 2, {0,0,0,0,0,5}, {32,546,0,0,0,0,0,0,0,0,0,0,0,0,0}};
-const DOM_SID global_sid_Builtin_Power_Users = /* Builtin power users */
+const struct dom_sid global_sid_Builtin_Power_Users = /* Builtin power users */
{ 1, 2, {0,0,0,0,0,5}, {32,547,0,0,0,0,0,0,0,0,0,0,0,0,0}};
-const DOM_SID global_sid_Builtin_Account_Operators = /* Builtin account operators */
+const struct dom_sid global_sid_Builtin_Account_Operators = /* Builtin account operators */
{ 1, 2, {0,0,0,0,0,5}, {32,548,0,0,0,0,0,0,0,0,0,0,0,0,0}};
-const DOM_SID global_sid_Builtin_Server_Operators = /* Builtin server operators */
+const struct dom_sid global_sid_Builtin_Server_Operators = /* Builtin server operators */
{ 1, 2, {0,0,0,0,0,5}, {32,549,0,0,0,0,0,0,0,0,0,0,0,0,0}};
-const DOM_SID global_sid_Builtin_Print_Operators = /* Builtin print operators */
+const struct dom_sid global_sid_Builtin_Print_Operators = /* Builtin print operators */
{ 1, 2, {0,0,0,0,0,5}, {32,550,0,0,0,0,0,0,0,0,0,0,0,0,0}};
-const DOM_SID global_sid_Builtin_Backup_Operators = /* Builtin backup operators */
+const struct dom_sid global_sid_Builtin_Backup_Operators = /* Builtin backup operators */
{ 1, 2, {0,0,0,0,0,5}, {32,551,0,0,0,0,0,0,0,0,0,0,0,0,0}};
-const DOM_SID global_sid_Builtin_Replicator = /* Builtin replicator */
+const struct dom_sid global_sid_Builtin_Replicator = /* Builtin replicator */
{ 1, 2, {0,0,0,0,0,5}, {32,552,0,0,0,0,0,0,0,0,0,0,0,0,0}};
-const DOM_SID global_sid_Builtin_PreWin2kAccess = /* Builtin pre win2k access */
+const struct dom_sid global_sid_Builtin_PreWin2kAccess = /* Builtin pre win2k access */
{ 1, 2, {0,0,0,0,0,5}, {32,554,0,0,0,0,0,0,0,0,0,0,0,0,0}};
-const DOM_SID global_sid_Unix_Users = /* Unmapped Unix users */
+const struct dom_sid global_sid_Unix_Users = /* Unmapped Unix users */
{ 1, 1, {0,0,0,0,0,22}, {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0}};
-const DOM_SID global_sid_Unix_Groups = /* Unmapped Unix groups */
+const struct dom_sid global_sid_Unix_Groups = /* Unmapped Unix groups */
{ 1, 1, {0,0,0,0,0,22}, {2,0,0,0,0,0,0,0,0,0,0,0,0,0,0}};
/* Unused, left here for documentary purposes */
* An NT compatible anonymous token.
*/
-static DOM_SID anon_sid_array[3] =
+static struct dom_sid anon_sid_array[3] =
{ { 1, 1, {0,0,0,0,0,1}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}},
{ 1, 1, {0,0,0,0,0,5}, {2,0,0,0,0,0,0,0,0,0,0,0,0,0,0}},
{ 1, 1, {0,0,0,0,0,5}, {7,0,0,0,0,0,0,0,0,0,0,0,0,0,0}} };
NT_USER_TOKEN anonymous_token = { 3, anon_sid_array, SE_NONE };
-static DOM_SID system_sid_array[1] =
+static struct dom_sid system_sid_array[1] =
{ { 1, 1, {0,0,0,0,0,5}, {18,0,0,0,0,0,0,0,0,0,0,0,0,0,0}} };
NT_USER_TOKEN system_token = { 1, system_sid_array, SE_ALL_PRIVS };
Convert a SID to an ascii string.
*****************************************************************/
-char *sid_to_fstring(fstring sidstr_out, const DOM_SID *sid)
+char *sid_to_fstring(fstring sidstr_out, const struct dom_sid *sid)
{
char *str = sid_string_talloc(talloc_tos(), sid);
fstrcpy(sidstr_out, str);
be turned around if necessary
*****************************************************************/
-char *sid_string_talloc(TALLOC_CTX *mem_ctx, const DOM_SID *sid)
+char *sid_string_talloc(TALLOC_CTX *mem_ctx, const struct dom_sid *sid)
{
char *result = dom_sid_string(mem_ctx, sid);
SMB_ASSERT(result != NULL);
Useful function for debug lines.
*****************************************************************/
-char *sid_string_dbg(const DOM_SID *sid)
+char *sid_string_dbg(const struct dom_sid *sid)
{
return sid_string_talloc(talloc_tos(), sid);
}
Use with care!
*****************************************************************/
-char *sid_string_tos(const DOM_SID *sid)
+char *sid_string_tos(const struct dom_sid *sid)
{
return sid_string_talloc(talloc_tos(), sid);
}
Convert a string to a SID. Returns True on success, False on fail.
*****************************************************************/
-bool string_to_sid(DOM_SID *sidout, const char *sidstr)
+bool string_to_sid(struct dom_sid *sidout, const char *sidstr)
{
const char *p;
char *q;
Add a rid to the end of a sid
*****************************************************************/
-bool sid_append_rid(DOM_SID *sid, uint32 rid)
+bool sid_append_rid(struct dom_sid *sid, uint32 rid)
{
if (sid->num_auths < MAXSUBAUTHS) {
sid->sub_auths[sid->num_auths++] = rid;
return False;
}
-bool sid_compose(DOM_SID *dst, const DOM_SID *domain_sid, uint32 rid)
+bool sid_compose(struct dom_sid *dst, const struct dom_sid *domain_sid, uint32 rid)
{
sid_copy(dst, domain_sid);
return sid_append_rid(dst, rid);
Removes the last rid from the end of a sid
*****************************************************************/
-bool sid_split_rid(DOM_SID *sid, uint32 *rid)
+bool sid_split_rid(struct dom_sid *sid, uint32 *rid)
{
if (sid->num_auths > 0) {
sid->num_auths--;
Return the last rid from the end of a sid
*****************************************************************/
-bool sid_peek_rid(const DOM_SID *sid, uint32 *rid)
+bool sid_peek_rid(const struct dom_sid *sid, uint32 *rid)
{
if (!sid || !rid)
return False;
and check the sid against the exp_dom_sid
*****************************************************************/
-bool sid_peek_check_rid(const DOM_SID *exp_dom_sid, const DOM_SID *sid, uint32 *rid)
+bool sid_peek_check_rid(const struct dom_sid *exp_dom_sid, const struct dom_sid *sid, uint32 *rid)
{
if (!exp_dom_sid || !sid || !rid)
return False;
Copies a sid
*****************************************************************/
-void sid_copy(DOM_SID *dst, const DOM_SID *src)
+void sid_copy(struct dom_sid *dst, const struct dom_sid *src)
{
int i;
Write a sid out into on-the-wire format.
*****************************************************************/
-bool sid_linearize(char *outbuf, size_t len, const DOM_SID *sid)
+bool sid_linearize(char *outbuf, size_t len, const struct dom_sid *sid)
{
size_t i;
}
/*****************************************************************
- Parse a on-the-wire SID to a DOM_SID.
+ Parse a on-the-wire SID to a struct dom_sid.
*****************************************************************/
-bool sid_parse(const char *inbuf, size_t len, DOM_SID *sid)
+bool sid_parse(const char *inbuf, size_t len, struct dom_sid *sid)
{
int i;
if (len < 8)
Compare the auth portion of two sids.
*****************************************************************/
-static int sid_compare_auth(const DOM_SID *sid1, const DOM_SID *sid2)
+static int sid_compare_auth(const struct dom_sid *sid1, const struct dom_sid *sid2)
{
int i;
Compare two sids.
*****************************************************************/
-int sid_compare(const DOM_SID *sid1, const DOM_SID *sid2)
+int sid_compare(const struct dom_sid *sid1, const struct dom_sid *sid2)
{
int i;
this just compares the leading sub-auths
*****************************************************************/
-int sid_compare_domain(const DOM_SID *sid1, const DOM_SID *sid2)
+int sid_compare_domain(const struct dom_sid *sid1, const struct dom_sid *sid2)
{
int n, i;
Compare two sids.
*****************************************************************/
-bool sid_equal(const DOM_SID *sid1, const DOM_SID *sid2)
+bool sid_equal(const struct dom_sid *sid1, const struct dom_sid *sid2)
{
return sid_compare(sid1, sid2) == 0;
}
Returns true if SID is internal (and non-mappable).
*****************************************************************/
-bool non_mappable_sid(DOM_SID *sid)
+bool non_mappable_sid(struct dom_sid *sid)
{
- DOM_SID dom;
+ struct dom_sid dom;
uint32 rid;
sid_copy(&dom, sid);
}
/*****************************************************************
- Return the binary string representation of a DOM_SID.
+ Return the binary string representation of a struct dom_sid.
Caller must free.
*****************************************************************/
-char *sid_binstring(TALLOC_CTX *mem_ctx, const DOM_SID *sid)
+char *sid_binstring(TALLOC_CTX *mem_ctx, const struct dom_sid *sid)
{
uint8_t *buf;
char *s;
}
/*****************************************************************
- Return the binary string representation of a DOM_SID.
+ Return the binary string representation of a struct dom_sid.
Caller must free.
*****************************************************************/
-char *sid_binstring_hex(const DOM_SID *sid)
+char *sid_binstring_hex(const struct dom_sid *sid)
{
char *buf, *s;
int len = ndr_size_dom_sid(sid, 0);
Add SID to an array SIDs
********************************************************************/
-NTSTATUS add_sid_to_array(TALLOC_CTX *mem_ctx, const DOM_SID *sid,
- DOM_SID **sids, size_t *num)
+NTSTATUS add_sid_to_array(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
+ struct dom_sid **sids, size_t *num)
{
- *sids = TALLOC_REALLOC_ARRAY(mem_ctx, *sids, DOM_SID,
+ *sids = TALLOC_REALLOC_ARRAY(mem_ctx, *sids, struct dom_sid,
(*num)+1);
if (*sids == NULL) {
*num = 0;
Add SID to an array SIDs ensuring that it is not already there
********************************************************************/
-NTSTATUS add_sid_to_array_unique(TALLOC_CTX *mem_ctx, const DOM_SID *sid,
- DOM_SID **sids, size_t *num_sids)
+NTSTATUS add_sid_to_array_unique(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
+ struct dom_sid **sids, size_t *num_sids)
{
size_t i;
Remove SID from an array
********************************************************************/
-void del_sid_from_array(const DOM_SID *sid, DOM_SID **sids, size_t *num)
+void del_sid_from_array(const struct dom_sid *sid, struct dom_sid **sids, size_t *num)
{
- DOM_SID *sid_list = *sids;
+ struct dom_sid *sid_list = *sids;
size_t i;
for ( i=0; i<*num; i++ ) {
return True;
}
-bool is_null_sid(const DOM_SID *sid)
+bool is_null_sid(const struct dom_sid *sid)
{
- static const DOM_SID null_sid = {0};
+ static const struct dom_sid null_sid = {0};
return sid_equal(sid, &null_sid);
}
-bool is_sid_in_token(const NT_USER_TOKEN *token, const DOM_SID *sid)
+bool is_sid_in_token(const NT_USER_TOKEN *token, const struct dom_sid *sid)
{
int i;
NTSTATUS sid_array_from_info3(TALLOC_CTX *mem_ctx,
const struct netr_SamInfo3 *info3,
- DOM_SID **user_sids,
+ struct dom_sid **user_sids,
size_t *num_user_sids,
bool include_user_group_rid,
bool skip_ressource_groups)
{
NTSTATUS status;
- DOM_SID sid;
- DOM_SID *sid_array = NULL;
+ struct dom_sid sid;
+ struct dom_sid *sid_array = NULL;
size_t num_sids = 0;
int i;
return pwd;
}
-struct passwd * winbind_getpwsid(const DOM_SID *sid)
+struct passwd * winbind_getpwsid(const struct dom_sid *sid)
{
wbcErr result;
struct passwd * tmp_pwd = NULL;
/* Call winbindd to convert a name to a sid */
-bool winbind_lookup_name(const char *dom_name, const char *name, DOM_SID *sid,
+bool winbind_lookup_name(const char *dom_name, const char *name, struct dom_sid *sid,
enum lsa_SidType *name_type)
{
struct wbcDomainSid dom_sid;
if (result != WBC_ERR_SUCCESS)
return false;
- memcpy(sid, &dom_sid, sizeof(DOM_SID));
+ memcpy(sid, &dom_sid, sizeof(struct dom_sid));
*name_type = (enum lsa_SidType)type;
return true;
/* Call winbindd to convert sid to name */
-bool winbind_lookup_sid(TALLOC_CTX *mem_ctx, const DOM_SID *sid,
+bool winbind_lookup_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
const char **domain, const char **name,
enum lsa_SidType *name_type)
{
/* Call winbindd to convert SID to uid */
-bool winbind_sid_to_uid(uid_t *puid, const DOM_SID *sid)
+bool winbind_sid_to_uid(uid_t *puid, const struct dom_sid *sid)
{
struct wbcDomainSid dom_sid;
wbcErr result;
/* Call winbindd to convert uid to sid */
-bool winbind_uid_to_sid(DOM_SID *sid, uid_t uid)
+bool winbind_uid_to_sid(struct dom_sid *sid, uid_t uid)
{
struct wbcDomainSid dom_sid;
wbcErr result;
result = wbcUidToSid(uid, &dom_sid);
if (result == WBC_ERR_SUCCESS) {
- memcpy(sid, &dom_sid, sizeof(DOM_SID));
+ memcpy(sid, &dom_sid, sizeof(struct dom_sid));
} else {
sid_copy(sid, &global_sid_NULL);
}
/* Call winbindd to convert SID to gid */
-bool winbind_sid_to_gid(gid_t *pgid, const DOM_SID *sid)
+bool winbind_sid_to_gid(gid_t *pgid, const struct dom_sid *sid)
{
struct wbcDomainSid dom_sid;
wbcErr result;
/* Call winbindd to convert gid to sid */
-bool winbind_gid_to_sid(DOM_SID *sid, gid_t gid)
+bool winbind_gid_to_sid(struct dom_sid *sid, gid_t gid)
{
struct wbcDomainSid dom_sid;
wbcErr result;
result = wbcGidToSid(gid, &dom_sid);
if (result == WBC_ERR_SUCCESS) {
- memcpy(sid, &dom_sid, sizeof(DOM_SID));
+ memcpy(sid, &dom_sid, sizeof(struct dom_sid));
} else {
sid_copy(sid, &global_sid_NULL);
}
/* Lookup a set of rids in a given domain */
bool winbind_lookup_rids(TALLOC_CTX *mem_ctx,
- const DOM_SID *domain_sid,
+ const struct dom_sid *domain_sid,
int num_rids, uint32 *rids,
const char **domain_name,
const char ***names, enum lsa_SidType **types)
}
bool winbind_get_sid_aliases(TALLOC_CTX *mem_ctx,
- const DOM_SID *dom_sid,
- const DOM_SID *members,
+ const struct dom_sid *dom_sid,
+ const struct dom_sid *members,
size_t num_members,
uint32_t **pp_alias_rids,
size_t *p_num_alias_rids)
return NULL;
}
-struct passwd * winbind_getpwsid(const DOM_SID *sid)
+struct passwd * winbind_getpwsid(const struct dom_sid *sid)
{
return NULL;
}
-bool winbind_lookup_name(const char *dom_name, const char *name, DOM_SID *sid,
+bool winbind_lookup_name(const char *dom_name, const char *name, struct dom_sid *sid,
enum lsa_SidType *name_type)
{
return false;
/* Call winbindd to convert sid to name */
-bool winbind_lookup_sid(TALLOC_CTX *mem_ctx, const DOM_SID *sid,
+bool winbind_lookup_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
const char **domain, const char **name,
enum lsa_SidType *name_type)
{
/* Call winbindd to convert SID to uid */
-bool winbind_sid_to_uid(uid_t *puid, const DOM_SID *sid)
+bool winbind_sid_to_uid(uid_t *puid, const struct dom_sid *sid)
{
return false;
}
/* Call winbindd to convert uid to sid */
-bool winbind_uid_to_sid(DOM_SID *sid, uid_t uid)
+bool winbind_uid_to_sid(struct dom_sid *sid, uid_t uid)
{
return false;
}
/* Call winbindd to convert SID to gid */
-bool winbind_sid_to_gid(gid_t *pgid, const DOM_SID *sid)
+bool winbind_sid_to_gid(gid_t *pgid, const struct dom_sid *sid)
{
return false;
}
/* Call winbindd to convert gid to sid */
-bool winbind_gid_to_sid(DOM_SID *sid, gid_t gid)
+bool winbind_gid_to_sid(struct dom_sid *sid, gid_t gid)
{
return false;
}
/* Lookup a set of rids in a given domain */
bool winbind_lookup_rids(TALLOC_CTX *mem_ctx,
- const DOM_SID *domain_sid,
+ const struct dom_sid *domain_sid,
int num_rids, uint32 *rids,
const char **domain_name,
const char ***names, enum lsa_SidType **types)
}
bool winbind_get_sid_aliases(TALLOC_CTX *mem_ctx,
- const DOM_SID *dom_sid,
- const DOM_SID *members,
+ const struct dom_sid *dom_sid,
+ const struct dom_sid *members,
size_t num_members,
uint32_t **pp_alias_rids,
size_t *p_num_alias_rids)
{
int i;
for (i=0; values[i]; i++) {
- DOM_SID sid;
+ struct dom_sid sid;
fstring tmp;
sid_parse(values[i]->bv_val, values[i]->bv_len, &sid);
printf("%s: %s\n", field, sid_to_fstring(tmp, &sid));
/**
- * pull a single DOM_SID from a ADS result
+ * pull a single struct dom_sid from a ADS result
* @param ads connection to ads server
* @param msg Results of search
* @param field Attribute to retrieve
* @return boolean inidicating success
*/
bool ads_pull_sid(ADS_STRUCT *ads, LDAPMessage *msg, const char *field,
- DOM_SID *sid)
+ struct dom_sid *sid)
{
return smbldap_pull_sid(ads->ldap.ld, msg, field, sid);
}
/**
- * pull an array of DOM_SIDs from a ADS result
+ * pull an array of struct dom_sids from a ADS result
* @param ads connection to ads server
* @param mem_ctx TALLOC_CTX for allocating sid array
* @param msg Results of search
* @return the count of SIDs pulled
**/
int ads_pull_sids(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx,
- LDAPMessage *msg, const char *field, DOM_SID **sids)
+ LDAPMessage *msg, const char *field, struct dom_sid **sids)
{
struct berval **values;
bool ret;
/* nop */ ;
if (i) {
- (*sids) = TALLOC_ARRAY(mem_ctx, DOM_SID, i);
+ (*sids) = TALLOC_ARRAY(mem_ctx, struct dom_sid, i);
if (!(*sids)) {
ldap_value_free_len(values);
return 0;
* @param sid Pointer to domain sid
* @return status of search
**/
-ADS_STATUS ads_domain_sid(ADS_STRUCT *ads, DOM_SID *sid)
+ADS_STATUS ads_domain_sid(ADS_STRUCT *ads, struct dom_sid *sid)
{
const char *attrs[] = {"objectSid", NULL};
LDAPMessage *res;
/**
- * pull a DOM_SID from an extended dn string
+ * pull a struct dom_sid from an extended dn string
* @param mem_ctx TALLOC_CTX
* @param extended_dn string
* @param flags string type of extended_dn
- * @param sid pointer to a DOM_SID
+ * @param sid pointer to a struct dom_sid
* @return NT_STATUS_OK on success,
* NT_INVALID_PARAMETER on error,
* NT_STATUS_NOT_FOUND if no SID present
ADS_STATUS ads_get_sid_from_extended_dn(TALLOC_CTX *mem_ctx,
const char *extended_dn,
enum ads_extended_dn_flags flags,
- DOM_SID *sid)
+ struct dom_sid *sid)
{
char *p, *q, *dn;
}
/**
- * pull an array of DOM_SIDs from a ADS result
+ * pull an array of struct dom_sids from a ADS result
* @param ads connection to ads server
* @param mem_ctx TALLOC_CTX for allocating sid array
* @param msg Results of search
LDAPMessage *msg,
const char *field,
enum ads_extended_dn_flags flags,
- DOM_SID **sids)
+ struct dom_sid **sids)
{
int i;
ADS_STATUS rc;
return 0;
}
- (*sids) = TALLOC_ZERO_ARRAY(mem_ctx, DOM_SID, dn_count + 1);
+ (*sids) = TALLOC_ZERO_ARRAY(mem_ctx, struct dom_sid, dn_count + 1);
if (!(*sids)) {
TALLOC_FREE(dn_strings);
return 0;
* @param ads connection to ads server
* @param mem_ctx TALLOC_CTX for allocating sid array
* @param dn of LDAP object
- * @param user_sid pointer to DOM_SID (objectSid)
- * @param primary_group_sid pointer to DOM_SID (self composed)
+ * @param user_sid pointer to struct dom_sid (objectSid)
+ * @param primary_group_sid pointer to struct dom_sid (self composed)
* @param sids pointer to sid array to allocate
* @param num_sids counter of SIDs pulled
* @return status of token query
ADS_STATUS ads_get_tokensids(ADS_STRUCT *ads,
TALLOC_CTX *mem_ctx,
const char *dn,
- DOM_SID *user_sid,
- DOM_SID *primary_group_sid,
- DOM_SID **sids,
+ struct dom_sid *user_sid,
+ struct dom_sid *primary_group_sid,
+ struct dom_sid **sids,
size_t *num_sids)
{
ADS_STATUS status;
LDAPMessage *res = NULL;
int count = 0;
size_t tmp_num_sids;
- DOM_SID *tmp_sids;
- DOM_SID tmp_user_sid;
- DOM_SID tmp_primary_group_sid;
+ struct dom_sid *tmp_sids;
+ struct dom_sid tmp_user_sid;
+ struct dom_sid tmp_primary_group_sid;
uint32 pgid;
const char *attrs[] = {
"objectSid",
/* hack to compose the primary group sid without knowing the
* domsid */
- DOM_SID domsid;
+ struct dom_sid domsid;
uint32 dummy_rid;
sid_copy(&domsid, &tmp_user_sid);
}
ADS_STATUS ads_search_retry_sid(ADS_STRUCT *ads, LDAPMessage **res,
- const DOM_SID *sid,
+ const struct dom_sid *sid,
const char **attrs)
{
char *dn, *sid_string;
struct GROUP_POLICY_OBJECT *gpo_list);
WERROR gp_reg_state_read(TALLOC_CTX *mem_ctx,
uint32_t flags,
- const DOM_SID *sid,
+ const struct dom_sid *sid,
struct GROUP_POLICY_OBJECT **gpo_list);
WERROR gp_secure_key(TALLOC_CTX *mem_ctx,
uint32_t flags,
struct registry_key *key,
- const DOM_SID *sid);
+ const struct dom_sid *sid);
void dump_reg_val(int lvl, const char *direction,
const char *key, const char *subkey,
struct registry_value *val);
****************************************************************/
static const char *gp_reg_groupmembership_path(TALLOC_CTX *mem_ctx,
- const DOM_SID *sid,
+ const struct dom_sid *sid,
uint32_t flags)
{
if (flags & GPO_LIST_FLAG_MACHINE) {
/* not used yet */
static WERROR gp_reg_read_groupmembership(TALLOC_CTX *mem_ctx,
struct gp_registry_context *reg_ctx,
- const DOM_SID *object_sid,
+ const struct dom_sid *object_sid,
struct nt_user_token **token,
uint32_t flags)
{
****************************************************************/
static const char *gp_req_state_path(TALLOC_CTX *mem_ctx,
- const DOM_SID *sid,
+ const struct dom_sid *sid,
uint32_t flags)
{
if (flags & GPO_LIST_FLAG_MACHINE) {
WERROR gp_reg_state_read(TALLOC_CTX *mem_ctx,
uint32_t flags,
- const DOM_SID *sid,
+ const struct dom_sid *sid,
struct GROUP_POLICY_OBJECT **gpo_list)
{
struct gp_registry_context *reg_ctx = NULL;
****************************************************************/
static WERROR gp_reg_generate_sd(TALLOC_CTX *mem_ctx,
- const DOM_SID *sid,
+ const struct dom_sid *sid,
struct security_descriptor **sd,
size_t *sd_size)
{
WERROR gp_secure_key(TALLOC_CTX *mem_ctx,
uint32_t flags,
struct registry_key *key,
- const DOM_SID *sid)
+ const struct dom_sid *sid)
{
struct security_descriptor *sd = NULL;
size_t sd_size = 0;
- const DOM_SID *sd_sid = NULL;
+ const struct dom_sid *sd_sid = NULL;
WERROR werr;
if (!(flags & GPO_LIST_FLAG_MACHINE)) {
struct samu *sam_account=NULL;
GROUP_MAP map;
struct group *grp;
- DOM_SID user_sid;
- DOM_SID group_sid;
+ struct dom_sid user_sid;
+ struct dom_sid group_sid;
struct passwd *passwd = NULL;
fstring sid_string;
fstring name;
fstring comment;
struct group *grp = NULL;
- DOM_SID group_sid;
+ struct dom_sid group_sid;
fstring sid_string;
GROUP_MAP map;
bool insert = true;
int i;
char **nt_members = NULL;
char **unix_members;
- DOM_SID group_sid;
+ struct dom_sid group_sid;
GROUP_MAP map;
struct group *grp;
for (i=0; i < r->num_rids; i++) {
struct samu *member = NULL;
- DOM_SID member_sid;
+ struct dom_sid member_sid;
if ( !(member = samu_new(mem_ctx)) ) {
return NT_STATUS_NO_MEMORY;
static NTSTATUS fetch_alias_info(TALLOC_CTX *mem_ctx,
uint32_t rid,
struct netr_DELTA_ALIAS *r,
- const DOM_SID *dom_sid)
+ const struct dom_sid *dom_sid)
{
fstring name;
fstring comment;
struct group *grp = NULL;
- DOM_SID alias_sid;
+ struct dom_sid alias_sid;
fstring sid_string;
GROUP_MAP map;
bool insert = true;
static NTSTATUS fetch_alias_mem(TALLOC_CTX *mem_ctx,
uint32_t rid,
struct netr_DELTA_ALIAS_MEMBER *r,
- const DOM_SID *dom_sid)
+ const struct dom_sid *dom_sid)
{
return NT_STATUS_OK;
}
struct messaging_context *msg_ctx,
struct sockaddr_storage *dc_ss,
const char *domain_name,
- const DOM_SID *sid,
+ const struct dom_sid *sid,
uint32_t nt_version)
{
struct in_addr dc_ip;
return result;
}
-void dump_ntquota(SMB_NTQUOTA_STRUCT *qt, bool _verbose, bool _numeric, void (*_sidtostring)(fstring str, DOM_SID *sid, bool _numeric))
+void dump_ntquota(SMB_NTQUOTA_STRUCT *qt, bool _verbose, bool _numeric, void (*_sidtostring)(fstring str, struct dom_sid *sid, bool _numeric))
{
TALLOC_CTX *frame = talloc_stackframe();
return;
}
-void dump_ntquota_list(SMB_NTQUOTA_LIST **qtl, bool _verbose, bool _numeric, void (*_sidtostring)(fstring str, DOM_SID *sid, bool _numeric))
+void dump_ntquota_list(SMB_NTQUOTA_LIST **qtl, bool _verbose, bool _numeric, void (*_sidtostring)(fstring str, struct dom_sid *sid, bool _numeric))
{
SMB_NTQUOTA_LIST *cur;
struct policy_handle *pol,
fstring str,
bool numeric,
- DOM_SID *sid)
+ struct dom_sid *sid)
{
char **domains = NULL;
char **names = NULL;
convert_string_to_sid(struct cli_state *ipc_cli,
struct policy_handle *pol,
bool numeric,
- DOM_SID *sid,
+ struct dom_sid *sid,
const char *str)
{
enum lsa_SidType *types = NULL;
- DOM_SID *sids = NULL;
+ struct dom_sid *sids = NULL;
bool result = True;
TALLOC_CTX *ctx = NULL;
struct rpc_pipe_client *pipe_hnd = find_lsa_pipe_hnd(ipc_cli);
unsigned int atype;
unsigned int aflags;
unsigned int amask;
- DOM_SID sid;
+ struct dom_sid sid;
uint32_t mask;
const struct perm_value *v;
struct perm_value {
char *tok;
struct security_descriptor *ret = NULL;
size_t sd_size;
- DOM_SID *group_sid=NULL;
- DOM_SID *owner_sid=NULL;
+ struct dom_sid *group_sid=NULL;
+ struct dom_sid *owner_sid=NULL;
struct security_acl *dacl=NULL;
int revision=1;
DEBUG(5,("OWNER specified more than once!\n"));
goto done;
}
- owner_sid = SMB_CALLOC_ARRAY(DOM_SID, 1);
+ owner_sid = SMB_CALLOC_ARRAY(struct dom_sid, 1);
if (!owner_sid ||
!convert_string_to_sid(ipc_cli, pol,
numeric,
DEBUG(5,("OWNER specified more than once!\n"));
goto done;
}
- owner_sid = SMB_CALLOC_ARRAY(DOM_SID, 1);
+ owner_sid = SMB_CALLOC_ARRAY(struct dom_sid, 1);
if (!owner_sid ||
!convert_string_to_sid(ipc_cli, pol,
False,
DEBUG(5,("GROUP specified more than once!\n"));
goto done;
}
- group_sid = SMB_CALLOC_ARRAY(DOM_SID, 1);
+ group_sid = SMB_CALLOC_ARRAY(struct dom_sid, 1);
if (!group_sid ||
!convert_string_to_sid(ipc_cli, pol,
numeric,
DEBUG(5,("GROUP specified more than once!\n"));
goto done;
}
- group_sid = SMB_CALLOC_ARRAY(DOM_SID, 1);
+ group_sid = SMB_CALLOC_ARRAY(struct dom_sid, 1);
if (!group_sid ||
!convert_string_to_sid(ipc_cli, pol,
False,
int err = 0;
struct security_descriptor *sd = NULL, *old;
struct security_acl *dacl = NULL;
- DOM_SID *owner_sid = NULL;
- DOM_SID *group_sid = NULL;
+ struct dom_sid *owner_sid = NULL;
+ struct dom_sid *group_sid = NULL;
uint32 i, j;
size_t sd_size;
int ret = 0;
void netsamlogon_clear_cached_user(struct netr_SamInfo3 *info3)
{
- DOM_SID user_sid;
+ struct dom_sid user_sid;
fstring keystr, tmp;
if (!info3) {
TDB_DATA data;
fstring keystr, tmp;
bool result = false;
- DOM_SID user_sid;
+ struct dom_sid user_sid;
time_t t = time(NULL);
TALLOC_CTX *mem_ctx;
DATA_BLOB blob;
free the user_info struct (malloc()'d memory)
***********************************************************************/
-struct netr_SamInfo3 *netsamlogon_cache_get(TALLOC_CTX *mem_ctx, const DOM_SID *user_sid)
+struct netr_SamInfo3 *netsamlogon_cache_get(TALLOC_CTX *mem_ctx, const struct dom_sid *user_sid)
{
struct netr_SamInfo3 *info3 = NULL;
TDB_DATA data;
#endif
}
-bool netsamlogon_cache_have(const DOM_SID *user_sid)
+bool netsamlogon_cache_have(const struct dom_sid *user_sid)
{
TALLOC_CTX *mem_ctx = talloc_init("netsamlogon_cache_have");
struct netr_SamInfo3 *info3 = NULL;
* false if store attempt failed
**/
-bool trustdom_cache_store(char* name, char* alt_name, const DOM_SID *sid,
+bool trustdom_cache_store(char* name, char* alt_name, const struct dom_sid *sid,
time_t timeout)
{
char *key, *alt_key;
* false if has expired/doesn't exist
**/
-bool trustdom_cache_fetch(const char* name, DOM_SID* sid)
+bool trustdom_cache_fetch(const char* name, struct dom_sid* sid)
{
char *key = NULL, *value = NULL;
time_t timeout;
DEBUG(5, ("trusted domain %s found (%s)\n", name, value));
}
- /* convert sid string representation into DOM_SID structure */
+ /* convert sid string representation into struct dom_sid structure */
if(! string_to_sid(sid, value)) {
sid = NULL;
SAFE_FREE(value);
void update_trustdom_cache( void )
{
char **domain_names;
- DOM_SID *dom_sids;
+ struct dom_sid *dom_sids;
uint32 num_domains;
uint32 last_check;
int time_diff;
bool enumerate_domain_trusts( TALLOC_CTX *mem_ctx, const char *domain,
char ***domain_names, uint32 *num_domains,
- DOM_SID **sids )
+ struct dom_sid **sids )
{
struct policy_handle pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
goto done;
}
- *sids = TALLOC_ZERO_ARRAY(mem_ctx, DOM_SID, *num_domains);
+ *sids = TALLOC_ZERO_ARRAY(mem_ctx, struct dom_sid, *num_domains);
if (!*sids) {
result = NT_STATUS_NO_MEMORY;
goto done;
}
static bool smbacl4_nfs42win(TALLOC_CTX *mem_ctx, SMB4ACL_T *theacl, /* in */
- DOM_SID *psid_owner, /* in */
- DOM_SID *psid_group, /* in */
+ struct dom_sid *psid_owner, /* in */
+ struct dom_sid *psid_group, /* in */
bool is_directory, /* in */
struct security_ace **ppnt_ace_list, /* out */
int *pgood_aces /* out */
for (aceint=aclint->first; aceint!=NULL; aceint=(SMB_ACE4_INT_T *)aceint->next) {
uint32_t mask;
- DOM_SID sid;
+ struct dom_sid sid;
SMB_ACE4PROP_T *ace = &aceint->prop;
uint32_t mapped_ace_flags;
struct security_descriptor **ppdesc, SMB4ACL_T *theacl)
{
int good_aces = 0;
- DOM_SID sid_owner, sid_group;
+ struct dom_sid sid_owner, sid_group;
size_t sd_size = 0;
struct security_ace *nt_ace_list = NULL;
struct security_acl *psa = NULL;
return NULL;
}
-static bool nfs4_map_sid(smbacl4_vfs_params *params, const DOM_SID *src,
- DOM_SID *dst)
+static bool nfs4_map_sid(smbacl4_vfs_params *params, const struct dom_sid *src,
+ struct dom_sid *dst)
{
static struct db_context *mapping_db = NULL;
TDB_DATA data;
enum lsa_SidType type;
uid_t uid;
gid_t gid;
- DOM_SID sid;
+ struct dom_sid sid;
sid_copy(&sid, &ace_nt->trustee);
if (!lookup_sid(mem_ctx, &sid, &dom, &name, &type)) {
- DOM_SID mapped;
+ struct dom_sid mapped;
if (!nfs4_map_sid(params, &sid, &mapped)) {
DEBUG(1, ("nfs4_acls.c: file [%s]: SID %s "
* Turn SID into UID/GID and setup a struct ifs_identity
*/
static bool
-onefs_sid_to_identity(const DOM_SID *sid, struct ifs_identity *id,
+onefs_sid_to_identity(const struct dom_sid *sid, struct ifs_identity *id,
bool is_group)
{
enum ifs_identity_type type = IFS_ID_TYPE_LAST+1;
* Turn struct ifs_identity into SID
*/
static bool
-onefs_identity_to_sid(struct ifs_identity *id, DOM_SID *sid)
+onefs_identity_to_sid(struct ifs_identity *id, struct dom_sid *sid)
{
if (!id || !sid)
return false;
}
static bool
-onefs_og_to_identity(DOM_SID *sid, struct ifs_identity * ident,
+onefs_og_to_identity(struct dom_sid *sid, struct ifs_identity * ident,
bool is_group, int snum)
{
- const DOM_SID *b_admin_sid = &global_sid_Builtin_Administrators;
+ const struct dom_sid *b_admin_sid = &global_sid_Builtin_Administrators;
if (!onefs_sid_to_identity(sid, ident, is_group)) {
if (!lp_parm_bool(snum, PARM_ONEFS_TYPE,
}
static bool
-sid_in_ignore_list(DOM_SID * sid, int snum)
+sid_in_ignore_list(struct dom_sid * sid, int snum)
{
const char ** sid_list = NULL;
- DOM_SID match;
+ struct dom_sid match;
sid_list = lp_parm_string_list(snum, PARM_ONEFS_TYPE,
PARM_UNMAPPABLE_SIDS_IGNORE_LIST,
}
for (i = 0; i < num_aces; i++) {
- DOM_SID sid;
+ struct dom_sid sid;
if (!onefs_identity_to_sid(&acl->aces[i].trustee, &sid))
goto err_free;
uint32_t sd_size = 0;
size_t size = 0;
struct ifs_security_descriptor *sd = NULL;
- DOM_SID owner_sid, group_sid;
- DOM_SID *ownerp, *groupp;
+ struct dom_sid owner_sid, group_sid;
+ struct dom_sid *ownerp, *groupp;
struct security_acl *dacl, *sacl;
struct security_descriptor *pdesc;
bool alloced = false;
#define MAXSIZE 2048
-extern const DOM_SID global_sid_World;
-extern const DOM_SID global_sid_Builtin_Administrators;
-extern const DOM_SID global_sid_Builtin_Backup_Operators;
-extern const DOM_SID global_sid_Authenticated_Users;
-extern const DOM_SID global_sid_NULL;
+extern const struct dom_sid global_sid_World;
+extern const struct dom_sid global_sid_Builtin_Administrators;
+extern const struct dom_sid global_sid_Builtin_Backup_Operators;
+extern const struct dom_sid global_sid_Authenticated_Users;
+extern const struct dom_sid global_sid_NULL;
static char space_replacement = '%';
struct afs_ace {
bool positive;
char *name;
- DOM_SID sid;
+ struct dom_sid sid;
enum lsa_SidType type;
uint32 rights;
struct afs_ace *next;
bool positive,
const char *name, uint32 rights)
{
- DOM_SID sid;
+ struct dom_sid sid;
enum lsa_SidType type;
struct afs_ace *result;
struct security_descriptor **ppdesc)
{
struct security_ace *nt_ace_list;
- DOM_SID owner_sid, group_sid;
+ struct dom_sid owner_sid, group_sid;
struct security_acl *psa = NULL;
int good_aces;
size_t sd_size;
return afs_to_nt_acl_common(afs_acl, &sbuf, security_info, ppdesc);
}
-static bool mappable_sid(const DOM_SID *sid)
+static bool mappable_sid(const struct dom_sid *sid)
{
- DOM_SID domain_sid;
+ struct dom_sid domain_sid;
if (sid_compare(sid, &global_sid_Builtin_Administrators) == 0)
return True;
bool lookup_name(TALLOC_CTX *mem_ctx,
const char *full_name, int flags,
const char **ret_domain, const char **ret_name,
- DOM_SID *ret_sid, enum lsa_SidType *ret_type)
+ struct dom_sid *ret_sid, enum lsa_SidType *ret_type)
{
char *p;
const char *tmp;
const char *domain = NULL;
const char *name = NULL;
uint32 rid;
- DOM_SID sid;
+ struct dom_sid sid;
enum lsa_SidType type;
TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
* that (yet), but give it a chance. */
if (IS_DC && winbind_lookup_name("", name, &sid, &type)) {
- DOM_SID dom_sid;
+ struct dom_sid dom_sid;
uint32 tmp_rid;
enum lsa_SidType domain_type;
bool lookup_name_smbconf(TALLOC_CTX *mem_ctx,
const char *full_name, int flags,
const char **ret_domain, const char **ret_name,
- DOM_SID *ret_sid, enum lsa_SidType *ret_type)
+ struct dom_sid *ret_sid, enum lsa_SidType *ret_type)
{
char *qualified_name;
const char *p;
}
static bool wb_lookup_rids(TALLOC_CTX *mem_ctx,
- const DOM_SID *domain_sid,
+ const struct dom_sid *domain_sid,
int num_rids, uint32 *rids,
const char **domain_name,
const char **names, enum lsa_SidType *types)
return true;
}
-static bool lookup_rids(TALLOC_CTX *mem_ctx, const DOM_SID *domain_sid,
+static bool lookup_rids(TALLOC_CTX *mem_ctx, const struct dom_sid *domain_sid,
int num_rids, uint32_t *rids,
const char **domain_name,
const char ***names, enum lsa_SidType **types)
if (sid_check_is_wellknown_domain(domain_sid, NULL)) {
for (i=0; i<num_rids; i++) {
- DOM_SID sid;
+ struct dom_sid sid;
sid_compose(&sid, domain_sid, rids[i]);
if (lookup_wellknown_sid(mem_ctx, &sid,
domain_name, &(*names)[i])) {
* Is the SID a domain as such? If yes, lookup its name.
*/
-static bool lookup_as_domain(const DOM_SID *sid, TALLOC_CTX *mem_ctx,
+static bool lookup_as_domain(const struct dom_sid *sid, TALLOC_CTX *mem_ctx,
const char **name)
{
const char *tmp;
* Level 6: Like 4
*/
-static bool check_dom_sid_to_level(const DOM_SID *sid, int level)
+static bool check_dom_sid_to_level(const struct dom_sid *sid, int level)
{
int ret = false;
*/
NTSTATUS lookup_sids(TALLOC_CTX *mem_ctx, int num_sids,
- const DOM_SID **sids, int level,
+ const struct dom_sid **sids, int level,
struct lsa_dom_info **ret_domains,
struct lsa_name_info **ret_names)
{
*/
for (i=0; i<num_sids; i++) {
- DOM_SID sid;
+ struct dom_sid sid;
uint32 rid;
const char *domain_name = NULL;
*THE CANONICAL* convert SID to name function.
*****************************************************************/
-bool lookup_sid(TALLOC_CTX *mem_ctx, const DOM_SID *sid,
+bool lookup_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
const char **ret_domain, const char **ret_name,
enum lsa_SidType *ret_type)
{
Find a SID given a uid.
*****************************************************************/
-static bool fetch_sid_from_uid_cache(DOM_SID *psid, uid_t uid)
+static bool fetch_sid_from_uid_cache(struct dom_sid *psid, uid_t uid)
{
DATA_BLOB cache_value;
Find a uid given a SID.
*****************************************************************/
-static bool fetch_uid_from_cache( uid_t *puid, const DOM_SID *psid )
+static bool fetch_uid_from_cache( uid_t *puid, const struct dom_sid *psid )
{
DATA_BLOB cache_value;
Store uid to SID mapping in cache.
*****************************************************************/
-void store_uid_sid_cache(const DOM_SID *psid, uid_t uid)
+void store_uid_sid_cache(const struct dom_sid *psid, uid_t uid)
{
memcache_add(NULL, SID_UID_CACHE,
data_blob_const(psid, ndr_size_dom_sid(psid, 0)),
Find a SID given a gid.
*****************************************************************/
-static bool fetch_sid_from_gid_cache(DOM_SID *psid, gid_t gid)
+static bool fetch_sid_from_gid_cache(struct dom_sid *psid, gid_t gid)
{
DATA_BLOB cache_value;
Find a gid given a SID.
*****************************************************************/
-static bool fetch_gid_from_cache(gid_t *pgid, const DOM_SID *psid)
+static bool fetch_gid_from_cache(gid_t *pgid, const struct dom_sid *psid)
{
DATA_BLOB cache_value;
Store gid to SID mapping in cache.
*****************************************************************/
-void store_gid_sid_cache(const DOM_SID *psid, gid_t gid)
+void store_gid_sid_cache(const struct dom_sid *psid, gid_t gid)
{
memcache_add(NULL, SID_GID_CACHE,
data_blob_const(psid, ndr_size_dom_sid(psid, 0)),
*THE LEGACY* convert uid_t to SID function.
*****************************************************************/
-static void legacy_uid_to_sid(DOM_SID *psid, uid_t uid)
+static void legacy_uid_to_sid(struct dom_sid *psid, uid_t uid)
{
bool ret;
*THE LEGACY* convert gid_t to SID function.
*****************************************************************/
-static void legacy_gid_to_sid(DOM_SID *psid, gid_t gid)
+static void legacy_gid_to_sid(struct dom_sid *psid, gid_t gid)
{
bool ret;
*THE LEGACY* convert SID to uid function.
*****************************************************************/
-static bool legacy_sid_to_uid(const DOM_SID *psid, uid_t *puid)
+static bool legacy_sid_to_uid(const struct dom_sid *psid, uid_t *puid)
{
enum lsa_SidType type;
Group mapping is used for gids that maps to Wellknown SIDs
*****************************************************************/
-static bool legacy_sid_to_gid(const DOM_SID *psid, gid_t *pgid)
+static bool legacy_sid_to_gid(const struct dom_sid *psid, gid_t *pgid)
{
GROUP_MAP map;
union unid_t id;
*THE CANONICAL* convert uid_t to SID function.
*****************************************************************/
-void uid_to_sid(DOM_SID *psid, uid_t uid)
+void uid_to_sid(struct dom_sid *psid, uid_t uid)
{
bool expired = true;
bool ret;
*THE CANONICAL* convert gid_t to SID function.
*****************************************************************/
-void gid_to_sid(DOM_SID *psid, gid_t gid)
+void gid_to_sid(struct dom_sid *psid, gid_t gid)
{
bool expired = true;
bool ret;
*THE CANONICAL* convert SID to uid function.
*****************************************************************/
-bool sid_to_uid(const DOM_SID *psid, uid_t *puid)
+bool sid_to_uid(const struct dom_sid *psid, uid_t *puid)
{
bool expired = true;
bool ret;
Group mapping is used for gids that maps to Wellknown SIDs
*****************************************************************/
-bool sid_to_gid(const DOM_SID *psid, gid_t *pgid)
+bool sid_to_gid(const struct dom_sid *psid, gid_t *pgid)
{
bool expired = true;
bool ret;
/* NOTE! the global_sam_sid is the SID of our local SAM. This is only
equal to the domain SID when we are a DC, otherwise its our
workstation SID */
-static DOM_SID *global_sam_sid=NULL;
+static struct dom_sid *global_sam_sid=NULL;
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_PASSDB
style of SID storage
****************************************************************************/
-static bool read_sid_from_file(const char *fname, DOM_SID *sid)
+static bool read_sid_from_file(const char *fname, struct dom_sid *sid)
{
char **lines;
int numlines;
/*
generate a random sid - used to build our own sid if we don't have one
*/
-static void generate_random_sid(DOM_SID *sid)
+static void generate_random_sid(struct dom_sid *sid)
{
int i;
uchar raw_sid_data[12];
Generate the global machine sid.
****************************************************************************/
-static DOM_SID *pdb_generate_sam_sid(void)
+static struct dom_sid *pdb_generate_sam_sid(void)
{
- DOM_SID domain_sid;
+ struct dom_sid domain_sid;
char *fname = NULL;
- DOM_SID *sam_sid;
+ struct dom_sid *sam_sid;
- if(!(sam_sid=SMB_MALLOC_P(DOM_SID)))
+ if(!(sam_sid=SMB_MALLOC_P(struct dom_sid)))
return NULL;
if ( IS_DC ) {
}
/* return our global_sam_sid */
-DOM_SID *get_global_sam_sid(void)
+struct dom_sid *get_global_sam_sid(void)
{
struct db_context *db;
Check if the SID is our domain SID (S-1-5-21-x-y-z).
*****************************************************************/
-bool sid_check_is_domain(const DOM_SID *sid)
+bool sid_check_is_domain(const struct dom_sid *sid)
{
return sid_equal(sid, get_global_sam_sid());
}
Check if the SID is our domain SID (S-1-5-21-x-y-z).
*****************************************************************/
-bool sid_check_is_in_our_domain(const DOM_SID *sid)
+bool sid_check_is_in_our_domain(const struct dom_sid *sid)
{
- DOM_SID dom_sid;
+ struct dom_sid dom_sid;
uint32 rid;
sid_copy(&dom_sid, sid);
if ( create && (pdb_capabilities() & PDB_CAP_STORE_RIDS)) {
uint32_t user_rid;
- DOM_SID user_sid;
+ struct dom_sid user_sid;
if ( !pdb_new_rid( &user_rid ) ) {
DEBUG(3, ("Could not allocate a new RID\n"));
if ((flags & LOOKUP_NAME_GROUP) == 0) {
struct samu *sam_account = NULL;
- DOM_SID user_sid;
+ struct dom_sid user_sid;
if ( !(sam_account = samu_new( NULL )) ) {
return False;
static NTSTATUS pdb_ads_getsampwsid(struct pdb_methods *m,
struct samu *sam_acct,
- const DOM_SID *sid);
+ const struct dom_sid *sid);
static bool pdb_ads_gid_to_sid(struct pdb_methods *m, gid_t gid,
- DOM_SID *sid);
+ struct dom_sid *sid);
static bool pdb_ads_dnblob2sid(struct pdb_ads_state *state, DATA_BLOB *dnblob,
struct dom_sid *psid);
static NTSTATUS pdb_ads_sid2dn(struct pdb_ads_state *state,
static NTSTATUS pdb_ads_getsampwsid(struct pdb_methods *m,
struct samu *sam_acct,
- const DOM_SID *sid)
+ const struct dom_sid *sid)
{
struct pdb_ads_state *state = talloc_get_type_abort(
m->private_data, struct pdb_ads_state);
}
static NTSTATUS pdb_ads_getgrsid(struct pdb_methods *m, GROUP_MAP *map,
- DOM_SID sid)
+ struct dom_sid sid)
{
char *filter;
NTSTATUS status;
}
static NTSTATUS pdb_ads_delete_group_mapping_entry(struct pdb_methods *m,
- DOM_SID sid)
+ struct dom_sid sid)
{
return NT_STATUS_NOT_IMPLEMENTED;
}
static NTSTATUS pdb_ads_enum_group_mapping(struct pdb_methods *m,
- const DOM_SID *sid,
+ const struct dom_sid *sid,
enum lsa_SidType sid_name_use,
GROUP_MAP **pp_rmap,
size_t *p_num_entries,
static NTSTATUS pdb_ads_enum_group_members(struct pdb_methods *m,
TALLOC_CTX *mem_ctx,
- const DOM_SID *group,
+ const struct dom_sid *group,
uint32 **pmembers,
size_t *pnum_members)
{
static NTSTATUS pdb_ads_enum_group_memberships(struct pdb_methods *m,
TALLOC_CTX *mem_ctx,
struct samu *user,
- DOM_SID **pp_sids,
+ struct dom_sid **pp_sids,
gid_t **pp_gids,
size_t *p_num_groups)
{
}
static NTSTATUS pdb_ads_delete_alias(struct pdb_methods *m,
- const DOM_SID *sid)
+ const struct dom_sid *sid)
{
struct pdb_ads_state *state = talloc_get_type_abort(
m->private_data, struct pdb_ads_state);
}
static NTSTATUS pdb_ads_set_aliasinfo(struct pdb_methods *m,
- const DOM_SID *sid,
+ const struct dom_sid *sid,
struct acct_info *info)
{
struct pdb_ads_state *state = talloc_get_type_abort(
}
static NTSTATUS pdb_ads_mod_aliasmem(struct pdb_methods *m,
- const DOM_SID *alias,
- const DOM_SID *member,
+ const struct dom_sid *alias,
+ const struct dom_sid *member,
int mod_op)
{
struct pdb_ads_state *state = talloc_get_type_abort(
}
static NTSTATUS pdb_ads_add_aliasmem(struct pdb_methods *m,
- const DOM_SID *alias,
- const DOM_SID *member)
+ const struct dom_sid *alias,
+ const struct dom_sid *member)
{
return pdb_ads_mod_aliasmem(m, alias, member, TLDAP_MOD_ADD);
}
static NTSTATUS pdb_ads_del_aliasmem(struct pdb_methods *m,
- const DOM_SID *alias,
- const DOM_SID *member)
+ const struct dom_sid *alias,
+ const struct dom_sid *member)
{
return pdb_ads_mod_aliasmem(m, alias, member, TLDAP_MOD_DELETE);
}
}
static NTSTATUS pdb_ads_enum_aliasmem(struct pdb_methods *m,
- const DOM_SID *alias,
+ const struct dom_sid *alias,
TALLOC_CTX *mem_ctx,
- DOM_SID **pmembers,
+ struct dom_sid **pmembers,
size_t *pnum_members)
{
struct pdb_ads_state *state = talloc_get_type_abort(
static NTSTATUS pdb_ads_enum_alias_memberships(struct pdb_methods *m,
TALLOC_CTX *mem_ctx,
- const DOM_SID *domain_sid,
- const DOM_SID *members,
+ const struct dom_sid *domain_sid,
+ const struct dom_sid *members,
size_t num_members,
uint32_t **palias_rids,
size_t *pnum_alias_rids)
}
static NTSTATUS pdb_ads_lookup_rids(struct pdb_methods *m,
- const DOM_SID *domain_sid,
+ const struct dom_sid *domain_sid,
int num_rids,
uint32 *rids,
const char **names,
}
static NTSTATUS pdb_ads_lookup_names(struct pdb_methods *m,
- const DOM_SID *domain_sid,
+ const struct dom_sid *domain_sid,
int num_names,
const char **pp_names,
uint32 *rids,
static bool pdb_ads_search_aliases(struct pdb_methods *m,
struct pdb_search *search,
- const DOM_SID *sid)
+ const struct dom_sid *sid)
{
struct pdb_ads_search_state *sstate;
char *filter;
}
static bool pdb_ads_uid_to_sid(struct pdb_methods *m, uid_t uid,
- DOM_SID *sid)
+ struct dom_sid *sid)
{
struct pdb_ads_state *state = talloc_get_type_abort(
m->private_data, struct pdb_ads_state);
}
static bool pdb_ads_gid_to_sid(struct pdb_methods *m, gid_t gid,
- DOM_SID *sid)
+ struct dom_sid *sid)
{
struct pdb_ads_state *state = talloc_get_type_abort(
m->private_data, struct pdb_ads_state);
return true;
}
-static bool pdb_ads_sid_to_id(struct pdb_methods *m, const DOM_SID *sid,
+static bool pdb_ads_sid_to_id(struct pdb_methods *m, const struct dom_sid *sid,
union unid_t *id, enum lsa_SidType *type)
{
struct pdb_ads_state *state = talloc_get_type_abort(
static bool pdb_ads_get_trusteddom_pw(struct pdb_methods *m,
const char *domain, char** pwd,
- DOM_SID *sid,
+ struct dom_sid *sid,
time_t *pass_last_set_time)
{
return false;
static bool pdb_ads_set_trusteddom_pw(struct pdb_methods *m,
const char* domain, const char* pwd,
- const DOM_SID *sid)
+ const struct dom_sid *sid)
{
return false;
}
bool pdb_set_user_sid_from_rid (struct samu *sampass, uint32 rid, enum pdb_value_state flag)
{
- DOM_SID u_sid;
- const DOM_SID *global_sam_sid;
+ struct dom_sid u_sid;
+ const struct dom_sid *global_sam_sid;
if (!sampass)
return False;
bool pdb_set_group_sid_from_rid (struct samu *sampass, uint32 grid, enum pdb_value_state flag)
{
- DOM_SID g_sid;
- const DOM_SID *global_sam_sid;
+ struct dom_sid g_sid;
+ const struct dom_sid *global_sam_sid;
if (!sampass)
return False;
return sampass->plaintext_pw;
}
-const DOM_SID *pdb_get_user_sid(const struct samu *sampass)
+const struct dom_sid *pdb_get_user_sid(const struct samu *sampass)
{
return &sampass->user_sid;
}
-const DOM_SID *pdb_get_group_sid(struct samu *sampass)
+const struct dom_sid *pdb_get_group_sid(struct samu *sampass)
{
- DOM_SID *gsid;
+ struct dom_sid *gsid;
struct passwd *pwd;
bool need_lookup_sid = false;
/* generate the group SID from the user's primary Unix group */
- if ( !(gsid = TALLOC_ZERO_P( sampass, DOM_SID )) ) {
+ if ( !(gsid = TALLOC_ZERO_P( sampass, struct dom_sid )) ) {
return NULL;
}
gid_to_sid(gsid, pwd->pw_gid);
if (!is_null_sid(gsid)) {
- DOM_SID dgsid;
+ struct dom_sid dgsid;
uint32_t rid;
sid_copy(&dgsid, gsid);
enum lsa_SidType type = SID_NAME_UNKNOWN;
TALLOC_CTX *mem_ctx;
bool lookup_ret;
- const DOM_SID *usid = pdb_get_user_sid(sampass);
+ const struct dom_sid *usid = pdb_get_user_sid(sampass);
mem_ctx = talloc_init("pdb_get_group_sid");
if (!mem_ctx) {
return True;
}
-bool pdb_set_user_sid(struct samu *sampass, const DOM_SID *u_sid, enum pdb_value_state flag)
+bool pdb_set_user_sid(struct samu *sampass, const struct dom_sid *u_sid, enum pdb_value_state flag)
{
if (!u_sid)
return False;
bool pdb_set_user_sid_from_string(struct samu *sampass, fstring u_sid, enum pdb_value_state flag)
{
- DOM_SID new_sid;
+ struct dom_sid new_sid;
if (!u_sid)
return False;
have to allow the explicitly setting of a group SID here.
********************************************************************/
-bool pdb_set_group_sid(struct samu *sampass, const DOM_SID *g_sid, enum pdb_value_state flag)
+bool pdb_set_group_sid(struct samu *sampass, const struct dom_sid *g_sid, enum pdb_value_state flag)
{
gid_t gid;
- DOM_SID dug_sid;
+ struct dom_sid dug_sid;
if (!g_sid)
return False;
- if ( !(sampass->group_sid = TALLOC_P( sampass, DOM_SID )) ) {
+ if ( !(sampass->group_sid = TALLOC_P( sampass, struct dom_sid )) ) {
return False;
}
/**********************************************************************
**********************************************************************/
-bool pdb_getsampwsid(struct samu *sam_acct, const DOM_SID *sid)
+bool pdb_getsampwsid(struct samu *sam_acct, const struct dom_sid *sid)
{
struct pdb_methods *pdb = pdb_get_methods();
uint32_t rid;
return pdb->update_login_attempts(pdb, sam_acct, success);
}
-bool pdb_getgrsid(GROUP_MAP *map, DOM_SID sid)
+bool pdb_getgrsid(GROUP_MAP *map, struct dom_sid sid)
{
struct pdb_methods *pdb = pdb_get_methods();
return NT_STATUS_IS_OK(pdb->getgrsid(pdb, map, sid));
const char *name,
uint32_t *rid)
{
- DOM_SID group_sid;
+ struct dom_sid group_sid;
struct group *grp;
fstring tmp;
TALLOC_CTX *mem_ctx,
uint32_t rid)
{
- DOM_SID group_sid;
+ struct dom_sid group_sid;
GROUP_MAP map;
NTSTATUS status;
struct group *grp;
return pdb->update_group_mapping_entry(pdb, map);
}
-NTSTATUS pdb_delete_group_mapping_entry(DOM_SID sid)
+NTSTATUS pdb_delete_group_mapping_entry(struct dom_sid sid)
{
struct pdb_methods *pdb = pdb_get_methods();
return pdb->delete_group_mapping_entry(pdb, sid);
}
-bool pdb_enum_group_mapping(const DOM_SID *sid, enum lsa_SidType sid_name_use, GROUP_MAP **pp_rmap,
+bool pdb_enum_group_mapping(const struct dom_sid *sid, enum lsa_SidType sid_name_use, GROUP_MAP **pp_rmap,
size_t *p_num_entries, bool unix_only)
{
struct pdb_methods *pdb = pdb_get_methods();
}
NTSTATUS pdb_enum_group_members(TALLOC_CTX *mem_ctx,
- const DOM_SID *sid,
+ const struct dom_sid *sid,
uint32_t **pp_member_rids,
size_t *p_num_members)
{
}
NTSTATUS pdb_enum_group_memberships(TALLOC_CTX *mem_ctx, struct samu *user,
- DOM_SID **pp_sids, gid_t **pp_gids,
+ struct dom_sid **pp_sids, gid_t **pp_gids,
size_t *p_num_groups)
{
struct pdb_methods *pdb = pdb_get_methods();
*/
static bool pdb_user_in_group(TALLOC_CTX *mem_ctx, struct samu *account,
- const DOM_SID *group_sid)
+ const struct dom_sid *group_sid)
{
- DOM_SID *sids;
+ struct dom_sid *sids;
gid_t *gids;
size_t i, num_groups;
uint32_t group_rid,
uint32_t member_rid)
{
- DOM_SID group_sid, member_sid;
+ struct dom_sid group_sid, member_sid;
struct samu *account = NULL;
GROUP_MAP map;
struct group *grp;
uint32_t group_rid,
uint32_t member_rid)
{
- DOM_SID group_sid, member_sid;
+ struct dom_sid group_sid, member_sid;
struct samu *account = NULL;
GROUP_MAP map;
struct group *grp;
return pdb->create_alias(pdb, name, rid);
}
-NTSTATUS pdb_delete_alias(const DOM_SID *sid)
+NTSTATUS pdb_delete_alias(const struct dom_sid *sid)
{
struct pdb_methods *pdb = pdb_get_methods();
return pdb->delete_alias(pdb, sid);
}
-NTSTATUS pdb_get_aliasinfo(const DOM_SID *sid, struct acct_info *info)
+NTSTATUS pdb_get_aliasinfo(const struct dom_sid *sid, struct acct_info *info)
{
struct pdb_methods *pdb = pdb_get_methods();
return pdb->get_aliasinfo(pdb, sid, info);
}
-NTSTATUS pdb_set_aliasinfo(const DOM_SID *sid, struct acct_info *info)
+NTSTATUS pdb_set_aliasinfo(const struct dom_sid *sid, struct acct_info *info)
{
struct pdb_methods *pdb = pdb_get_methods();
return pdb->set_aliasinfo(pdb, sid, info);
}
-NTSTATUS pdb_add_aliasmem(const DOM_SID *alias, const DOM_SID *member)
+NTSTATUS pdb_add_aliasmem(const struct dom_sid *alias, const struct dom_sid *member)
{
struct pdb_methods *pdb = pdb_get_methods();
return pdb->add_aliasmem(pdb, alias, member);
}
-NTSTATUS pdb_del_aliasmem(const DOM_SID *alias, const DOM_SID *member)
+NTSTATUS pdb_del_aliasmem(const struct dom_sid *alias, const struct dom_sid *member)
{
struct pdb_methods *pdb = pdb_get_methods();
return pdb->del_aliasmem(pdb, alias, member);
}
-NTSTATUS pdb_enum_aliasmem(const DOM_SID *alias, TALLOC_CTX *mem_ctx,
- DOM_SID **pp_members, size_t *p_num_members)
+NTSTATUS pdb_enum_aliasmem(const struct dom_sid *alias, TALLOC_CTX *mem_ctx,
+ struct dom_sid **pp_members, size_t *p_num_members)
{
struct pdb_methods *pdb = pdb_get_methods();
return pdb->enum_aliasmem(pdb, alias, mem_ctx, pp_members,
}
NTSTATUS pdb_enum_alias_memberships(TALLOC_CTX *mem_ctx,
- const DOM_SID *domain_sid,
- const DOM_SID *members, size_t num_members,
+ const struct dom_sid *domain_sid,
+ const struct dom_sid *members, size_t num_members,
uint32_t **pp_alias_rids,
size_t *p_num_alias_rids)
{
p_num_alias_rids);
}
-NTSTATUS pdb_lookup_rids(const DOM_SID *domain_sid,
+NTSTATUS pdb_lookup_rids(const struct dom_sid *domain_sid,
int num_rids,
uint32_t *rids,
const char **names,
* used in this context some day.
*/
#if 0
-NTSTATUS pdb_lookup_names(const DOM_SID *domain_sid,
+NTSTATUS pdb_lookup_names(const struct dom_sid *domain_sid,
int num_names,
const char **names,
uint32_t *rids,
return NT_STATUS_IS_OK(pdb->get_seq_num(pdb, seq_num));
}
-bool pdb_uid_to_sid(uid_t uid, DOM_SID *sid)
+bool pdb_uid_to_sid(uid_t uid, struct dom_sid *sid)
{
struct pdb_methods *pdb = pdb_get_methods();
return pdb->uid_to_sid(pdb, uid, sid);
}
-bool pdb_gid_to_sid(gid_t gid, DOM_SID *sid)
+bool pdb_gid_to_sid(gid_t gid, struct dom_sid *sid)
{
struct pdb_methods *pdb = pdb_get_methods();
return pdb->gid_to_sid(pdb, gid, sid);
}
-bool pdb_sid_to_id(const DOM_SID *sid, union unid_t *id,
+bool pdb_sid_to_id(const struct dom_sid *sid, union unid_t *id,
enum lsa_SidType *type)
{
struct pdb_methods *pdb = pdb_get_methods();
return NT_STATUS_NO_SUCH_USER;
}
-static NTSTATUS pdb_default_getsampwsid(struct pdb_methods *my_methods, struct samu * user, const DOM_SID *sid)
+static NTSTATUS pdb_default_getsampwsid(struct pdb_methods *my_methods, struct samu * user, const struct dom_sid *sid)
{
return NT_STATUS_NO_SUCH_USER;
}
}
static bool pdb_default_uid_to_sid(struct pdb_methods *methods, uid_t uid,
- DOM_SID *sid)
+ struct dom_sid *sid)
{
struct samu *sampw = NULL;
struct passwd *unix_pw;
}
static bool pdb_default_gid_to_sid(struct pdb_methods *methods, gid_t gid,
- DOM_SID *sid)
+ struct dom_sid *sid)
{
GROUP_MAP map;
}
static bool pdb_default_sid_to_id(struct pdb_methods *methods,
- const DOM_SID *sid,
+ const struct dom_sid *sid,
union unid_t *id, enum lsa_SidType *type)
{
TALLOC_CTX *mem_ctx;
static NTSTATUS pdb_default_enum_group_members(struct pdb_methods *methods,
TALLOC_CTX *mem_ctx,
- const DOM_SID *group,
+ const struct dom_sid *group,
uint32_t **pp_member_rids,
size_t *p_num_members)
{
*pp_member_rids = TALLOC_ZERO_ARRAY(mem_ctx, uint32_t, num_uids);
for (i=0; i<num_uids; i++) {
- DOM_SID sid;
+ struct dom_sid sid;
uid_to_sid(&sid, uids[i]);
static NTSTATUS pdb_default_enum_group_memberships(struct pdb_methods *methods,
TALLOC_CTX *mem_ctx,
struct samu *user,
- DOM_SID **pp_sids,
+ struct dom_sid **pp_sids,
gid_t **pp_gids,
size_t *p_num_groups)
{
smb_panic("primary group missing");
}
- *pp_sids = TALLOC_ARRAY(mem_ctx, DOM_SID, *p_num_groups);
+ *pp_sids = TALLOC_ARRAY(mem_ctx, struct dom_sid, *p_num_groups);
if (*pp_sids == NULL) {
TALLOC_FREE(*pp_gids);
struct samu *sam_account = NULL;
GROUP_MAP map;
bool ret;
- DOM_SID sid;
+ struct dom_sid sid;
*psid_name_use = SID_NAME_UNKNOWN;
}
static NTSTATUS pdb_default_lookup_rids(struct pdb_methods *methods,
- const DOM_SID *domain_sid,
+ const struct dom_sid *domain_sid,
int num_rids,
uint32_t *rids,
const char **names,
#if 0
static NTSTATUS pdb_default_lookup_names(struct pdb_methods *methods,
- const DOM_SID *domain_sid,
+ const struct dom_sid *domain_sid,
int num_names,
const char **names,
uint32_t *rids,
}
static bool pdb_search_grouptype(struct pdb_search *search,
- const DOM_SID *sid, enum lsa_SidType type)
+ const struct dom_sid *sid, enum lsa_SidType type)
{
struct group_search *state;
static bool pdb_default_search_aliases(struct pdb_methods *methods,
struct pdb_search *search,
- const DOM_SID *sid)
+ const struct dom_sid *sid)
{
return pdb_search_grouptype(search, sid, SID_NAME_ALIAS);
return result;
}
-struct pdb_search *pdb_search_aliases(TALLOC_CTX *mem_ctx, const DOM_SID *sid)
+struct pdb_search *pdb_search_aliases(TALLOC_CTX *mem_ctx, const struct dom_sid *sid)
{
struct pdb_methods *pdb = pdb_get_methods();
struct pdb_search *result;
trustdom methods
*******************************************************************/
-bool pdb_get_trusteddom_pw(const char *domain, char** pwd, DOM_SID *sid,
+bool pdb_get_trusteddom_pw(const char *domain, char** pwd, struct dom_sid *sid,
time_t *pass_last_set_time)
{
struct pdb_methods *pdb = pdb_get_methods();
}
bool pdb_set_trusteddom_pw(const char* domain, const char* pwd,
- const DOM_SID *sid)
+ const struct dom_sid *sid)
{
struct pdb_methods *pdb = pdb_get_methods();
return pdb->set_trusteddom_pw(pdb, domain, pwd, sid);
static bool pdb_default_get_trusteddom_pw(struct pdb_methods *methods,
const char *domain,
char** pwd,
- DOM_SID *sid,
+ struct dom_sid *sid,
time_t *pass_last_set_time)
{
return secrets_fetch_trusted_domain_password(domain, pwd,
static bool pdb_default_set_trusteddom_pw(struct pdb_methods *methods,
const char* domain,
const char* pwd,
- const DOM_SID *sid)
+ const struct dom_sid *sid)
{
return secrets_store_trusted_domain_password(domain, pwd, sid);
}
******************************************************************/
static int ldapsam_search_suffix_by_sid (struct ldapsam_privates *ldap_state,
- const DOM_SID *sid, LDAPMessage ** result,
+ const struct dom_sid *sid, LDAPMessage ** result,
const char **attr)
{
char *filter = NULL;
struct passwd unix_pw;
bool have_uid = false;
bool have_gid = false;
- DOM_SID mapped_gsid;
- const DOM_SID *primary_gsid;
+ struct dom_sid mapped_gsid;
+ const struct dom_sid *primary_gsid;
ZERO_STRUCT(unix_pw);
/* only update the RID if we actually need to */
if (need_update(sampass, PDB_USERSID)) {
fstring sid_string;
- const DOM_SID *user_sid = pdb_get_user_sid(sampass);
+ const struct dom_sid *user_sid = pdb_get_user_sid(sampass);
switch ( ldap_state->schema_ver ) {
case SCHEMAVER_SAMBAACCOUNT:
if (need_update(sampass, PDB_GROUPSID)) {
fstring sid_string;
- const DOM_SID *group_sid = pdb_get_group_sid(sampass);
+ const struct dom_sid *group_sid = pdb_get_group_sid(sampass);
switch ( ldap_state->schema_ver ) {
case SCHEMAVER_SAMBAACCOUNT:
}
static int ldapsam_get_ldap_user_by_sid(struct ldapsam_privates *ldap_state,
- const DOM_SID *sid, LDAPMessage **result)
+ const struct dom_sid *sid, LDAPMessage **result)
{
int rc = -1;
const char ** attr_list;
Get struct samu entry from LDAP by SID.
*********************************************************************/
-static NTSTATUS ldapsam_getsampwsid(struct pdb_methods *my_methods, struct samu * user, const DOM_SID *sid)
+static NTSTATUS ldapsam_getsampwsid(struct pdb_methods *my_methods, struct samu * user, const struct dom_sid *sid)
{
struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)my_methods->private_data;
LDAPMessage *result = NULL;
static NTSTATUS ldapsam_enum_group_memberships(struct pdb_methods *methods,
TALLOC_CTX *mem_ctx,
struct samu *user,
- DOM_SID **pp_sids,
+ struct dom_sid **pp_sids,
gid_t **pp_gids,
size_t *p_num_groups);
const char **attr_list;
char *escape_user = NULL;
const char *username = pdb_get_username(newpwd);
- const DOM_SID *sid = pdb_get_user_sid(newpwd);
+ const struct dom_sid *sid = pdb_get_user_sid(newpwd);
char *filter = NULL;
char *dn = NULL;
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
*********************************************************************/
static NTSTATUS ldapsam_getgrsid(struct pdb_methods *methods, GROUP_MAP *map,
- DOM_SID sid)
+ struct dom_sid sid)
{
char *filter = NULL;
NTSTATUS status;
static bool ldapsam_extract_rid_from_entry(LDAP *ldap_struct,
LDAPMessage *entry,
- const DOM_SID *domain_sid,
+ const struct dom_sid *domain_sid,
uint32_t *rid)
{
fstring str;
- DOM_SID sid;
+ struct dom_sid sid;
if (!smbldap_get_single_attribute(ldap_struct, entry, "sambaSID",
str, sizeof(str)-1)) {
static NTSTATUS ldapsam_enum_group_members(struct pdb_methods *methods,
TALLOC_CTX *mem_ctx,
- const DOM_SID *group,
+ const struct dom_sid *group,
uint32_t **pp_member_rids,
size_t *p_num_members)
{
entry = ldap_next_entry(conn->ldap_struct, entry))
{
char *sidstr;
- DOM_SID sid;
+ struct dom_sid sid;
uint32_t rid;
sidstr = smbldap_talloc_single_attribute(conn->ldap_struct,
static NTSTATUS ldapsam_enum_group_memberships(struct pdb_methods *methods,
TALLOC_CTX *mem_ctx,
struct samu *user,
- DOM_SID **pp_sids,
+ struct dom_sid **pp_sids,
gid_t **pp_gids,
size_t *p_num_groups)
{
entry = ldap_next_entry(conn->ldap_struct, entry))
{
fstring str;
- DOM_SID sid;
+ struct dom_sid sid;
gid_t gid;
char *end;
TALLOC_CTX *mem_ctx;
NTSTATUS result;
- DOM_SID sid;
+ struct dom_sid sid;
int rc;
*********************************************************************/
static NTSTATUS ldapsam_delete_group_mapping_entry(struct pdb_methods *methods,
- DOM_SID sid)
+ struct dom_sid sid)
{
struct ldapsam_privates *priv =
(struct ldapsam_privates *)methods->private_data;
*********************************************************************/
static NTSTATUS ldapsam_enum_group_mapping(struct pdb_methods *methods,
- const DOM_SID *domsid, enum lsa_SidType sid_name_use,
+ const struct dom_sid *domsid, enum lsa_SidType sid_name_use,
GROUP_MAP **pp_rmap,
size_t *p_num_entries,
bool unix_only)
}
static NTSTATUS ldapsam_modify_aliasmem(struct pdb_methods *methods,
- const DOM_SID *alias,
- const DOM_SID *member,
+ const struct dom_sid *alias,
+ const struct dom_sid *member,
int modop)
{
struct ldapsam_privates *ldap_state =
}
static NTSTATUS ldapsam_add_aliasmem(struct pdb_methods *methods,
- const DOM_SID *alias,
- const DOM_SID *member)
+ const struct dom_sid *alias,
+ const struct dom_sid *member)
{
return ldapsam_modify_aliasmem(methods, alias, member, LDAP_MOD_ADD);
}
static NTSTATUS ldapsam_del_aliasmem(struct pdb_methods *methods,
- const DOM_SID *alias,
- const DOM_SID *member)
+ const struct dom_sid *alias,
+ const struct dom_sid *member)
{
return ldapsam_modify_aliasmem(methods, alias, member,
LDAP_MOD_DELETE);
}
static NTSTATUS ldapsam_enum_aliasmem(struct pdb_methods *methods,
- const DOM_SID *alias,
+ const struct dom_sid *alias,
TALLOC_CTX *mem_ctx,
- DOM_SID **pp_members,
+ struct dom_sid **pp_members,
size_t *p_num_members)
{
struct ldapsam_privates *ldap_state =
count = ldap_count_values(values);
for (i=0; i<count; i++) {
- DOM_SID member;
+ struct dom_sid member;
NTSTATUS status;
if (!string_to_sid(&member, values[i]))
static NTSTATUS ldapsam_alias_memberships(struct pdb_methods *methods,
TALLOC_CTX *mem_ctx,
- const DOM_SID *domain_sid,
- const DOM_SID *members,
+ const struct dom_sid *domain_sid,
+ const struct dom_sid *members,
size_t num_members,
uint32_t **pp_alias_rids,
size_t *p_num_alias_rids)
entry = ldap_next_entry(ldap_struct, entry))
{
fstring sid_str;
- DOM_SID sid;
+ struct dom_sid sid;
uint32_t rid;
if (!smbldap_get_single_attribute(ldap_struct, entry,
}
static NTSTATUS ldapsam_lookup_rids(struct pdb_methods *methods,
- const DOM_SID *domain_sid,
+ const struct dom_sid *domain_sid,
int num_rids,
uint32_t *rids,
const char **names,
}
for (i=0; i<num_rids; i++) {
- DOM_SID sid;
+ struct dom_sid sid;
sid_compose(&sid, domain_sid, rids[i]);
allsids = talloc_asprintf_append_buffer(
allsids, "(sambaSid=%s)",
{
char **vals;
size_t converted_size;
- DOM_SID sid;
+ struct dom_sid sid;
uint32_t acct_flags;
vals = ldap_get_values(ld, entry, "sambaAcctFlags");
{
char **vals;
size_t converted_size;
- DOM_SID sid;
+ struct dom_sid sid;
uint16_t group_type;
result->account_name = "";
static bool ldapsam_search_grouptype(struct pdb_methods *methods,
struct pdb_search *search,
- const DOM_SID *sid,
+ const struct dom_sid *sid,
enum lsa_SidType type)
{
struct ldapsam_privates *ldap_state =
static bool ldapsam_search_aliases(struct pdb_methods *methods,
struct pdb_search *search,
- const DOM_SID *sid)
+ const struct dom_sid *sid)
{
return ldapsam_search_grouptype(methods, search, sid, SID_NAME_ALIAS);
}
}
static bool ldapsam_sid_to_id(struct pdb_methods *methods,
- const DOM_SID *sid,
+ const struct dom_sid *sid,
union unid_t *id, enum lsa_SidType *type)
{
struct ldapsam_privates *priv =
* This is shortcut is only used if ldapsam:trusted is set to true.
*/
static bool ldapsam_uid_to_sid(struct pdb_methods *methods, uid_t uid,
- DOM_SID *sid)
+ struct dom_sid *sid)
{
struct ldapsam_privates *priv =
(struct ldapsam_privates *)methods->private_data;
* This is shortcut is only used if ldapsam:trusted is set to true.
*/
static bool ldapsam_gid_to_sid(struct pdb_methods *methods, gid_t gid,
- DOM_SID *sid)
+ struct dom_sid *sid)
{
struct ldapsam_privates *priv =
(struct ldapsam_privates *)methods->private_data;
LDAPMessage *entry = NULL;
bool ret = false;
char *group_sid_string;
- DOM_SID group_sid;
+ struct dom_sid group_sid;
int rc;
TALLOC_CTX *tmp_ctx = talloc_stackframe();
char *uidstr;
char *shell;
const char *dn = NULL;
- DOM_SID group_sid;
- DOM_SID user_sid;
+ struct dom_sid group_sid;
+ struct dom_sid user_sid;
gid_t gid = -1;
uid_t uid = -1;
NTSTATUS ret;
char *grouptype;
char *gidstr;
const char *dn = NULL;
- DOM_SID group_sid;
+ struct dom_sid group_sid;
gid_t gid = -1;
int rc;
const char *dn;
char *gidstr;
char *filter;
- DOM_SID group_sid;
+ struct dom_sid group_sid;
int rc;
/* get the group sid */
char *filter;
char *uidstr;
const char *dn = NULL;
- DOM_SID group_sid;
- DOM_SID member_sid;
+ struct dom_sid group_sid;
+ struct dom_sid member_sid;
int rc;
switch (modop) {
static bool ldapsam_get_trusteddom_pw(struct pdb_methods *methods,
const char *domain,
char** pwd,
- DOM_SID *sid,
+ struct dom_sid *sid,
time_t *pass_last_set_time)
{
struct ldapsam_privates *ldap_state =
static bool ldapsam_set_trusteddom_pw(struct pdb_methods *methods,
const char* domain,
const char* pwd,
- const DOM_SID *sid)
+ const struct dom_sid *sid)
{
struct ldapsam_privates *ldap_state =
(struct ldapsam_privates *)methods->private_data;
char *alg_rid_base_string = NULL;
LDAPMessage *result = NULL;
LDAPMessage *entry = NULL;
- DOM_SID ldap_domain_sid;
- DOM_SID secrets_domain_sid;
+ struct dom_sid ldap_domain_sid;
+ struct dom_sid secrets_domain_sid;
char *domain_sid_string = NULL;
char *dn = NULL;
char *uri = talloc_strdup( NULL, location );
return NT_STATUS_OK;
}
-static NTSTATUS smbpasswd_getsampwsid(struct pdb_methods *my_methods, struct samu *sam_acct, const DOM_SID *sid)
+static NTSTATUS smbpasswd_getsampwsid(struct pdb_methods *my_methods, struct samu *sam_acct, const struct dom_sid *sid)
{
NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
struct smbpasswd_privates *smbpasswd_state = (struct smbpasswd_privates*)my_methods->private_data;
}
static NTSTATUS tdbsam_getsampwsid(struct pdb_methods *my_methods,
- struct samu * user, const DOM_SID *sid)
+ struct samu * user, const struct dom_sid *sid)
{
uint32 rid;
return _pdb_wbc_sam_getsampw(methods, user, winbind_getpwnam(sname));
}
-static NTSTATUS pdb_wbc_sam_getsampwsid(struct pdb_methods *methods, struct samu *user, const DOM_SID *sid)
+static NTSTATUS pdb_wbc_sam_getsampwsid(struct pdb_methods *methods, struct samu *user, const struct dom_sid *sid)
{
return _pdb_wbc_sam_getsampw(methods, user, winbind_getpwsid(sid));
}
static bool pdb_wbc_sam_uid_to_sid(struct pdb_methods *methods, uid_t uid,
- DOM_SID *sid)
+ struct dom_sid *sid)
{
return winbind_uid_to_sid(sid, uid);
}
static bool pdb_wbc_sam_gid_to_sid(struct pdb_methods *methods, gid_t gid,
- DOM_SID *sid)
+ struct dom_sid *sid)
{
return winbind_gid_to_sid(sid, gid);
}
static NTSTATUS pdb_wbc_sam_enum_group_members(struct pdb_methods *methods,
TALLOC_CTX *mem_ctx,
- const DOM_SID *group,
+ const struct dom_sid *group,
uint32 **pp_member_rids,
size_t *p_num_members)
{
static NTSTATUS pdb_wbc_sam_enum_group_memberships(struct pdb_methods *methods,
TALLOC_CTX *mem_ctx,
struct samu *user,
- DOM_SID **pp_sids,
+ struct dom_sid **pp_sids,
gid_t **pp_gids,
size_t *p_num_groups)
{
smb_panic("primary group missing");
}
- *pp_sids = TALLOC_ARRAY(mem_ctx, DOM_SID, *p_num_groups);
+ *pp_sids = TALLOC_ARRAY(mem_ctx, struct dom_sid, *p_num_groups);
if (*pp_sids == NULL) {
TALLOC_FREE(*pp_gids);
}
static NTSTATUS pdb_wbc_sam_lookup_rids(struct pdb_methods *methods,
- const DOM_SID *domain_sid,
+ const struct dom_sid *domain_sid,
int num_rids,
uint32 *rids,
const char **names,
static bool pdb_wbc_sam_search_aliases(struct pdb_methods *methods,
struct pdb_search *search,
- const DOM_SID *sid)
+ const struct dom_sid *sid)
{
return false;
static bool pdb_wbc_sam_get_trusteddom_pw(struct pdb_methods *methods,
const char *domain,
char **pwd,
- DOM_SID *sid,
+ struct dom_sid *sid,
time_t *pass_last_set_time)
{
return false;
static bool pdb_wbc_sam_set_trusteddom_pw(struct pdb_methods *methods,
const char *domain,
const char *pwd,
- const DOM_SID *sid)
+ const struct dom_sid *sid)
{
return false;
}
return NT_STATUS_NOT_IMPLEMENTED;
}
-static bool _make_group_map(struct pdb_methods *methods, const char *domain, const char *name, enum lsa_SidType name_type, gid_t gid, DOM_SID *sid, GROUP_MAP *map)
+static bool _make_group_map(struct pdb_methods *methods, const char *domain, const char *name, enum lsa_SidType name_type, gid_t gid, struct dom_sid *sid, GROUP_MAP *map)
{
snprintf(map->nt_name, sizeof(map->nt_name), "%s%c%s",
domain, *lp_winbind_separator(), name);
}
static NTSTATUS pdb_wbc_sam_getgrsid(struct pdb_methods *methods, GROUP_MAP *map,
- DOM_SID sid)
+ struct dom_sid sid)
{
NTSTATUS result = NT_STATUS_OK;
char *name = NULL;
NTSTATUS result = NT_STATUS_OK;
char *name = NULL;
char *domain = NULL;
- DOM_SID sid;
+ struct dom_sid sid;
enum lsa_SidType name_type;
if (!winbind_gid_to_sid(&sid, gid)) {
{
NTSTATUS result = NT_STATUS_OK;
const char *domain = "";
- DOM_SID sid;
+ struct dom_sid sid;
gid_t gid;
enum lsa_SidType name_type;
}
static NTSTATUS pdb_wbc_sam_enum_group_mapping(struct pdb_methods *methods,
- const DOM_SID *sid, enum lsa_SidType sid_name_use,
+ const struct dom_sid *sid, enum lsa_SidType sid_name_use,
GROUP_MAP **pp_rmap, size_t *p_num_entries,
bool unix_only)
{
}
static NTSTATUS pdb_wbc_sam_get_aliasinfo(struct pdb_methods *methods,
- const DOM_SID *sid,
+ const struct dom_sid *sid,
struct acct_info *info)
{
return NT_STATUS_NOT_IMPLEMENTED;
}
static NTSTATUS pdb_wbc_sam_enum_aliasmem(struct pdb_methods *methods,
- const DOM_SID *alias,
+ const struct dom_sid *alias,
TALLOC_CTX *mem_ctx,
- DOM_SID **pp_members,
+ struct dom_sid **pp_members,
size_t *p_num_members)
{
return NT_STATUS_NOT_IMPLEMENTED;
static NTSTATUS pdb_wbc_sam_alias_memberships(struct pdb_methods *methods,
TALLOC_CTX *mem_ctx,
- const DOM_SID *domain_sid,
- const DOM_SID *members,
+ const struct dom_sid *domain_sid,
+ const struct dom_sid *members,
size_t num_members,
uint32 **pp_alias_rids,
size_t *p_num_alias_rids)
************************************************************************/
bool secrets_fetch_trusted_domain_password(const char *domain, char** pwd,
- DOM_SID *sid, time_t *pass_last_set_time)
+ struct dom_sid *sid, time_t *pass_last_set_time)
{
struct TRUSTED_DOM_PASS pass;
enum ndr_err_code ndr_err;
**/
bool secrets_store_trusted_domain_password(const char* domain, const char* pwd,
- const DOM_SID *sid)
+ const struct dom_sid *sid)
{
bool ret;
Check if the SID is the builtin SID (S-1-5-32).
*****************************************************************/
-bool sid_check_is_builtin(const DOM_SID *sid)
+bool sid_check_is_builtin(const struct dom_sid *sid)
{
return sid_equal(sid, &global_sid_Builtin);
}
Check if the SID is one of the builtin SIDs (S-1-5-32-a).
*****************************************************************/
-bool sid_check_is_in_builtin(const DOM_SID *sid)
+bool sid_check_is_in_builtin(const struct dom_sid *sid)
{
- DOM_SID dom_sid;
+ struct dom_sid dom_sid;
uint32 rid;
sid_copy(&dom_sid, sid);
#include "includes.h"
-bool sid_check_is_unix_users(const DOM_SID *sid)
+bool sid_check_is_unix_users(const struct dom_sid *sid)
{
return sid_equal(sid, &global_sid_Unix_Users);
}
-bool sid_check_is_in_unix_users(const DOM_SID *sid)
+bool sid_check_is_in_unix_users(const struct dom_sid *sid)
{
- DOM_SID dom_sid;
+ struct dom_sid dom_sid;
uint32 rid;
sid_copy(&dom_sid, sid);
return sid_check_is_unix_users(&dom_sid);
}
-bool uid_to_unix_users_sid(uid_t uid, DOM_SID *sid)
+bool uid_to_unix_users_sid(uid_t uid, struct dom_sid *sid)
{
return sid_compose(sid, &global_sid_Unix_Users, uid);
}
-bool gid_to_unix_groups_sid(gid_t gid, DOM_SID *sid)
+bool gid_to_unix_groups_sid(gid_t gid, struct dom_sid *sid)
{
return sid_compose(sid, &global_sid_Unix_Groups, gid);
}
return "Unix User";
}
-bool lookup_unix_user_name(const char *name, DOM_SID *sid)
+bool lookup_unix_user_name(const char *name, struct dom_sid *sid)
{
struct passwd *pwd;
bool ret;
return ret;
}
-bool sid_check_is_unix_groups(const DOM_SID *sid)
+bool sid_check_is_unix_groups(const struct dom_sid *sid)
{
return sid_equal(sid, &global_sid_Unix_Groups);
}
-bool sid_check_is_in_unix_groups(const DOM_SID *sid)
+bool sid_check_is_in_unix_groups(const struct dom_sid *sid)
{
- DOM_SID dom_sid;
+ struct dom_sid dom_sid;
uint32 rid;
sid_copy(&dom_sid, sid);
return "Unix Group";
}
-bool lookup_unix_group_name(const char *name, DOM_SID *sid)
+bool lookup_unix_group_name(const char *name, struct dom_sid *sid)
{
struct group *grp;
struct sid_name_map_info
{
- const DOM_SID *sid;
+ const struct dom_sid *sid;
const char *name;
const struct rid_name_map *known_users;
};
{ &global_sid_NT_Authority, "NT Authority", nt_authority_users },
{ NULL, NULL, NULL }};
-bool sid_check_is_wellknown_domain(const DOM_SID *sid, const char **name)
+bool sid_check_is_wellknown_domain(const struct dom_sid *sid, const char **name)
{
int i;
return False;
}
-bool sid_check_is_in_wellknown_domain(const DOM_SID *sid)
+bool sid_check_is_in_wellknown_domain(const struct dom_sid *sid)
{
- DOM_SID dom_sid;
+ struct dom_sid dom_sid;
uint32 rid;
sid_copy(&dom_sid, sid);
Looks up a known username from one of the known domains.
***************************************************************************/
-bool lookup_wellknown_sid(TALLOC_CTX *mem_ctx, const DOM_SID *sid,
+bool lookup_wellknown_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
const char **domain, const char **name)
{
int i;
- DOM_SID dom_sid;
+ struct dom_sid dom_sid;
uint32 rid;
const struct rid_name_map *users = NULL;
***************************************************************************/
bool lookup_wellknown_name(TALLOC_CTX *mem_ctx, const char *name,
- DOM_SID *sid, const char **domain)
+ struct dom_sid *sid, const char **domain)
{
int i, j;
uint32_t sa;
struct security_acl *psa = NULL;
struct security_descriptor *psd = NULL;
- DOM_SID adm_sid;
+ struct dom_sid adm_sid;
size_t sd_size;
/* Create an ACE where Everyone is allowed to print */
/* Add the domain admins group if we are a DC */
if ( IS_DC ) {
- DOM_SID domadmins_sid;
+ struct dom_sid domadmins_sid;
sid_compose(&domadmins_sid, get_global_sam_sid(),
DOMAIN_RID_ADMINS);
descriptor then copy them over from the old one. */
if (!secdesc_ctr->sd->owner_sid || !secdesc_ctr->sd->group_sid) {
- DOM_SID *owner_sid, *group_sid;
+ struct dom_sid *owner_sid, *group_sid;
struct security_acl *dacl, *sacl;
struct security_descriptor *psd = NULL;
size_t size;
struct security_acl *psa = NULL;
struct sec_desc_buf *sdb = NULL;
struct security_descriptor *psd = NULL;
- DOM_SID adm_sid;
+ struct dom_sid adm_sid;
size_t sd_size;
/* Create an ACE where Everyone is allowed to print */
/* Add the domain admins group if we are a DC */
if ( IS_DC ) {
- DOM_SID domadmins_sid;
+ struct dom_sid domadmins_sid;
sid_compose(&domadmins_sid, get_global_sam_sid(),
DOMAIN_RID_ADMINS);
down. Take ownership of security descriptor. */
if (sid_equal((*secdesc_ctr)->sd->owner_sid, &global_sid_World)) {
- DOM_SID owner_sid;
+ struct dom_sid owner_sid;
/* Change sd owner to workgroup administrator */
TALLOC_CTX *mem_ctx,
struct policy_handle *pol,
int num_sids,
- const DOM_SID *sids,
+ const struct dom_sid *sids,
char **domains,
char **names,
enum lsa_SidType *types,
TALLOC_CTX *mem_ctx,
struct policy_handle *pol,
int num_sids,
- const DOM_SID *sids,
+ const struct dom_sid *sids,
char ***pdomains,
char ***pnames,
enum lsa_SidType **ptypes,
NTSTATUS result = NT_STATUS_OK;
int sids_left = 0;
int sids_processed = 0;
- const DOM_SID *hunk_sids = sids;
+ const struct dom_sid *hunk_sids = sids;
char **hunk_domains;
char **hunk_names;
enum lsa_SidType *hunk_types;
TALLOC_CTX *mem_ctx,
struct policy_handle *pol,
int num_sids,
- const DOM_SID *sids,
+ const struct dom_sid *sids,
char ***pdomains,
char ***pnames,
enum lsa_SidType **ptypes)
TALLOC_CTX *mem_ctx,
struct policy_handle *pol,
int num_sids,
- const DOM_SID *sids,
+ const struct dom_sid *sids,
char ***pdomains,
char ***pnames,
enum lsa_SidType **ptypes)
const char **names,
const char ***dom_names,
int level,
- DOM_SID **sids,
+ struct dom_sid **sids,
enum lsa_SidType **types,
bool use_lookupnames4)
{
}
if (num_names) {
- if (!((*sids = TALLOC_ARRAY(mem_ctx, DOM_SID, num_names)))) {
+ if (!((*sids = TALLOC_ARRAY(mem_ctx, struct dom_sid, num_names)))) {
DEBUG(0, ("cli_lsa_lookup_sids(): out of memory\n"));
result = NT_STATUS_NO_MEMORY;
goto done;
for (i = 0; i < num_names; i++) {
uint32_t dom_idx;
- DOM_SID *sid = &(*sids)[i];
+ struct dom_sid *sid = &(*sids)[i];
if (use_lookupnames4) {
dom_idx = sid_array3.sids[i].sid_index;
const char **names,
const char ***dom_names,
int level,
- DOM_SID **sids,
+ struct dom_sid **sids,
enum lsa_SidType **types)
{
return rpccli_lsa_lookup_names_generic(cli, mem_ctx, pol, num_names,
const char **names,
const char ***dom_names,
int level,
- DOM_SID **sids,
+ struct dom_sid **sids,
enum lsa_SidType **types)
{
return rpccli_lsa_lookup_names_generic(cli, mem_ctx, pol, num_names,
TALLOC_CTX *mem_ctx,
struct policy_handle *pol,