diff options
author | Andrew Bartlett <abartlet@samba.org> | 2010-05-21 11:25:01 +1000 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2010-05-21 10:39:59 +0200 |
commit | cba7f8b8273e661d3c43652900d93e5a8eab4e5f (patch) | |
tree | 714e00240ddc0c7e689240d2c8fb7d9196b1fff2 /source3/groupdb | |
parent | a92b653af964364ee438c6ee69a87eb7603ceab0 (diff) | |
download | samba-cba7f8b8273e661d3c43652900d93e5a8eab4e5f.tar.gz samba-cba7f8b8273e661d3c43652900d93e5a8eab4e5f.tar.bz2 samba-cba7f8b8273e661d3c43652900d93e5a8eab4e5f.zip |
s3:dom_sid Global replace of DOM_SID with struct dom_sid
This matches the structure that new code is being written to,
and removes one more of the old-style named structures, and
the need to know that is is just an alias for struct dom_sid.
Andrew Bartlett
Signed-off-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'source3/groupdb')
-rw-r--r-- | source3/groupdb/mapping.c | 48 | ||||
-rw-r--r-- | source3/groupdb/mapping.h | 18 | ||||
-rw-r--r-- | source3/groupdb/mapping_tdb.c | 48 |
3 files changed, 57 insertions, 57 deletions
diff --git a/source3/groupdb/mapping.c b/source3/groupdb/mapping.c index da5a866619..4cfe9957f4 100644 --- a/source3/groupdb/mapping.c +++ b/source3/groupdb/mapping.c @@ -65,8 +65,8 @@ NTSTATUS add_initial_entry(gid_t gid, const char *sid, enum lsa_SidType sid_name 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; @@ -82,8 +82,8 @@ static NTSTATUS alias_memberships(const DOM_SID *members, size_t num_members, } struct aliasmem_closure { - const DOM_SID *alias; - DOM_SID **sids; + const struct dom_sid *alias; + struct dom_sid **sids; size_t *num; }; @@ -101,7 +101,7 @@ struct aliasmem_closure { /* 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; @@ -381,7 +381,7 @@ 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) { if (!init_group_mapping()) { DEBUG(0,("failed to initialize group mapping\n")); @@ -436,7 +436,7 @@ NTSTATUS pdb_default_update_group_mapping_entry(struct pdb_methods *methods, } 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")); @@ -447,7 +447,7 @@ NTSTATUS pdb_default_delete_group_mapping_entry(struct pdb_methods *methods, } 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) { @@ -462,7 +462,7 @@ NTSTATUS pdb_default_enum_group_mapping(struct pdb_methods *methods, 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; @@ -521,13 +521,13 @@ NTSTATUS pdb_default_create_alias(struct pdb_methods *methods, } 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; @@ -550,7 +550,7 @@ NTSTATUS pdb_default_get_aliasinfo(struct pdb_methods *methods, } 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; @@ -565,7 +565,7 @@ NTSTATUS pdb_default_set_aliasinfo(struct pdb_methods *methods, } 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")); @@ -575,7 +575,7 @@ NTSTATUS pdb_default_add_aliasmem(struct pdb_methods *methods, } 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")); @@ -585,8 +585,8 @@ NTSTATUS pdb_default_del_aliasmem(struct pdb_methods *methods, } 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")); @@ -598,13 +598,13 @@ NTSTATUS pdb_default_enum_aliasmem(struct pdb_methods *methods, 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; @@ -650,7 +650,7 @@ NTSTATUS pdb_default_alias_memberships(struct pdb_methods *methods, *********************************************************************/ NTSTATUS pdb_nop_getgrsid(struct pdb_methods *methods, GROUP_MAP *map, - DOM_SID sid) + struct dom_sid sid) { return NT_STATUS_UNSUCCESSFUL; } @@ -680,7 +680,7 @@ NTSTATUS pdb_nop_update_group_mapping_entry(struct pdb_methods *methods, } NTSTATUS pdb_nop_delete_group_mapping_entry(struct pdb_methods *methods, - DOM_SID sid) + struct dom_sid sid) { return NT_STATUS_UNSUCCESSFUL; } @@ -696,7 +696,7 @@ NTSTATUS pdb_nop_enum_group_mapping(struct pdb_methods *methods, /**************************************************************************** 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; @@ -714,7 +714,7 @@ bool pdb_get_dom_grp_info(const DOM_SID *sid, struct acct_info *info) 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; @@ -733,7 +733,7 @@ bool pdb_set_dom_grp_info(const DOM_SID *sid, const struct acct_info *info) NTSTATUS pdb_create_builtin_alias(uint32 rid) { - DOM_SID sid; + struct dom_sid sid; enum lsa_SidType type; gid_t gid; GROUP_MAP map; diff --git a/source3/groupdb/mapping.h b/source3/groupdb/mapping.h index 6bb490a7a4..045721d67e 100644 --- a/source3/groupdb/mapping.h +++ b/source3/groupdb/mapping.h @@ -40,17 +40,17 @@ 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); }; diff --git a/source3/groupdb/mapping_tdb.c b/source3/groupdb/mapping_tdb.c index 896ad456cd..f608e2e514 100644 --- a/source3/groupdb/mapping_tdb.c +++ b/source3/groupdb/mapping_tdb.c @@ -25,12 +25,12 @@ 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); @@ -109,7 +109,7 @@ static bool init_group_mapping(void) 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; @@ -162,7 +162,7 @@ static bool add_mapping_entry(GROUP_MAP *map, int flag) 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; @@ -286,7 +286,7 @@ static bool get_group_map_from_ntname(const char *name, GROUP_MAP *map) 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; @@ -307,7 +307,7 @@ static bool group_map_remove(const DOM_SID *sid) ****************************************************************************/ struct enum_map_state { - const DOM_SID *domsid; + const struct dom_sid *domsid; enum lsa_SidType sid_name_use; bool unix_only; @@ -358,7 +358,7 @@ static int collect_map(struct db_record *rec, void *private_data) 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) @@ -384,8 +384,8 @@ static bool enum_group_mapping(const DOM_SID *domsid, /* 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; @@ -407,7 +407,7 @@ static NTSTATUS one_alias_membership(const DOM_SID *member, 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; @@ -423,8 +423,8 @@ done: 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; @@ -439,9 +439,9 @@ static NTSTATUS alias_memberships(const DOM_SID *members, size_t num_members, 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 @@ -460,7 +460,7 @@ static bool is_aliasmem(const DOM_SID *alias, const DOM_SID *member) } -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; @@ -543,8 +543,8 @@ static NTSTATUS add_aliasmem(const DOM_SID *alias, const DOM_SID *member) 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; }; @@ -564,7 +564,7 @@ static int collect_aliasmem(struct db_record *rec, void *priv) 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)) @@ -601,8 +601,8 @@ static int collect_aliasmem(struct db_record *rec, void *priv) 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; @@ -626,10 +626,10 @@ static NTSTATUS enum_aliasmem(const DOM_SID *alias, TALLOC_CTX *mem_ctx, 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; @@ -760,7 +760,7 @@ static int convert_ldb_record(TDB_CONTEXT *ltdb, TDB_DATA key, 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) { @@ -839,7 +839,7 @@ static int convert_ldb_record(TDB_CONTEXT *ltdb, TDB_DATA key, 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; |