diff options
Diffstat (limited to 'source3')
-rw-r--r-- | source3/groupdb/mapping.c | 7 | ||||
-rw-r--r-- | source3/groupdb/mapping.h | 3 | ||||
-rw-r--r-- | source3/groupdb/mapping_ldb.c | 5 | ||||
-rw-r--r-- | source3/groupdb/mapping_tdb.c | 7 | ||||
-rw-r--r-- | source3/include/passdb.h | 4 | ||||
-rw-r--r-- | source3/include/proto.h | 5 | ||||
-rw-r--r-- | source3/passdb/pdb_interface.c | 5 | ||||
-rw-r--r-- | source3/passdb/pdb_ldap.c | 3 | ||||
-rw-r--r-- | source3/passdb/pdb_wbc_sam.c | 6 | ||||
-rw-r--r-- | source3/rpc_server/srv_samr_nt.c | 3 | ||||
-rw-r--r-- | source3/utils/net_groupmap.c | 3 | ||||
-rw-r--r-- | source3/utils/net_sam.c | 3 | ||||
-rw-r--r-- | source3/winbindd/winbindd_group.c | 4 |
13 files changed, 36 insertions, 22 deletions
diff --git a/source3/groupdb/mapping.c b/source3/groupdb/mapping.c index 4f05d732f1..12d0bd365c 100644 --- a/source3/groupdb/mapping.c +++ b/source3/groupdb/mapping.c @@ -606,14 +606,15 @@ NTSTATUS pdb_default_del_aliasmem(struct pdb_methods *methods, } NTSTATUS pdb_default_enum_aliasmem(struct pdb_methods *methods, - const DOM_SID *alias, DOM_SID **pp_members, - size_t *p_num_members) + const DOM_SID *alias, TALLOC_CTX *mem_ctx, + DOM_SID **pp_members, size_t *p_num_members) { if (!init_group_mapping()) { DEBUG(0,("failed to initialize group mapping\n")); return NT_STATUS_UNSUCCESSFUL; } - return backend->enum_aliasmem(alias, pp_members, p_num_members); + return backend->enum_aliasmem(alias, mem_ctx, pp_members, + p_num_members); } NTSTATUS pdb_default_alias_memberships(struct pdb_methods *methods, diff --git a/source3/groupdb/mapping.h b/source3/groupdb/mapping.h index c37ae84b87..519b0ae08a 100644 --- a/source3/groupdb/mapping.h +++ b/source3/groupdb/mapping.h @@ -29,5 +29,6 @@ struct mapping_backend { 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, DOM_SID **sids, size_t *num); + NTSTATUS (*enum_aliasmem)(const DOM_SID *alias, TALLOC_CTX *mem_ctx, + DOM_SID **sids, size_t *num); }; diff --git a/source3/groupdb/mapping_ldb.c b/source3/groupdb/mapping_ldb.c index cc06282aee..89966e1986 100644 --- a/source3/groupdb/mapping_ldb.c +++ b/source3/groupdb/mapping_ldb.c @@ -488,7 +488,8 @@ static NTSTATUS del_aliasmem(const DOM_SID *alias, const DOM_SID *member) /* enumerate sids that have the given alias set in member */ -static NTSTATUS enum_aliasmem(const DOM_SID *alias, DOM_SID **sids, size_t *num) +static NTSTATUS enum_aliasmem(const DOM_SID *alias, TALLOC_CTX *mem_ctx, + DOM_SID **sids, size_t *num) { const char *attrs[] = { "member", @@ -529,7 +530,7 @@ static NTSTATUS enum_aliasmem(const DOM_SID *alias, DOM_SID **sids, size_t *num) for (i=0;i<el->num_values;i++) { DOM_SID sid; string_to_sid(&sid, (const char *)el->values[i].data); - status = add_sid_to_array_unique(NULL, &sid, sids, num); + status = add_sid_to_array_unique(mem_ctx, &sid, sids, num); if (!NT_STATUS_IS_OK(status)) { goto done; } diff --git a/source3/groupdb/mapping_tdb.c b/source3/groupdb/mapping_tdb.c index 29927eb592..8498f0c821 100644 --- a/source3/groupdb/mapping_tdb.c +++ b/source3/groupdb/mapping_tdb.c @@ -535,6 +535,7 @@ 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; size_t *num; @@ -580,7 +581,7 @@ static int collect_aliasmem(struct db_record *rec, void *priv) if (!string_to_sid(&member, member_string)) continue; - if (!NT_STATUS_IS_OK(add_sid_to_array(NULL, &member, + if (!NT_STATUS_IS_OK(add_sid_to_array(state->mem_ctx, &member, state->sids, state->num))) { @@ -593,7 +594,8 @@ static int collect_aliasmem(struct db_record *rec, void *priv) return 0; } -static NTSTATUS enum_aliasmem(const DOM_SID *alias, DOM_SID **sids, size_t *num) +static NTSTATUS enum_aliasmem(const DOM_SID *alias, TALLOC_CTX *mem_ctx, + DOM_SID **sids, size_t *num) { GROUP_MAP map; struct aliasmem_state state; @@ -611,6 +613,7 @@ static NTSTATUS enum_aliasmem(const DOM_SID *alias, DOM_SID **sids, size_t *num) state.alias = alias; state.sids = sids; state.num = num; + state.mem_ctx = mem_ctx; db->traverse_read(db, collect_aliasmem, &state); return NT_STATUS_OK; diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 03d9f56c5a..d67c2842a6 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -311,8 +311,8 @@ struct pdb_methods NTSTATUS (*del_aliasmem)(struct pdb_methods *methods, const DOM_SID *alias, const DOM_SID *member); NTSTATUS (*enum_aliasmem)(struct pdb_methods *methods, - const DOM_SID *alias, DOM_SID **members, - size_t *p_num_members); + const DOM_SID *alias, TALLOC_CTX *mem_ctx, + 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, diff --git a/source3/include/proto.h b/source3/include/proto.h index 19314e06c7..40855a0650 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -231,7 +231,8 @@ 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); NTSTATUS pdb_default_enum_aliasmem(struct pdb_methods *methods, - const DOM_SID *alias, DOM_SID **pp_members, + const DOM_SID *alias, TALLOC_CTX *mem_ctx, + DOM_SID **pp_members, size_t *p_num_members); NTSTATUS pdb_default_alias_memberships(struct pdb_methods *methods, TALLOC_CTX *mem_ctx, @@ -4547,7 +4548,7 @@ 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, +NTSTATUS pdb_enum_aliasmem(const DOM_SID *alias, TALLOC_CTX *mem_ctx, DOM_SID **pp_members, size_t *p_num_members); NTSTATUS pdb_enum_alias_memberships(TALLOC_CTX *mem_ctx, const DOM_SID *domain_sid, diff --git a/source3/passdb/pdb_interface.c b/source3/passdb/pdb_interface.c index fdf09ae13b..a61dcb19d3 100644 --- a/source3/passdb/pdb_interface.c +++ b/source3/passdb/pdb_interface.c @@ -933,11 +933,12 @@ NTSTATUS pdb_del_aliasmem(const DOM_SID *alias, const DOM_SID *member) return pdb->del_aliasmem(pdb, alias, member); } -NTSTATUS pdb_enum_aliasmem(const DOM_SID *alias, +NTSTATUS pdb_enum_aliasmem(const DOM_SID *alias, TALLOC_CTX *mem_ctx, DOM_SID **pp_members, size_t *p_num_members) { struct pdb_methods *pdb = pdb_get_methods(); - return pdb->enum_aliasmem(pdb, alias, pp_members, p_num_members); + return pdb->enum_aliasmem(pdb, alias, mem_ctx, pp_members, + p_num_members); } NTSTATUS pdb_enum_alias_memberships(TALLOC_CTX *mem_ctx, diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c index 2272aedf13..dddde75a4e 100644 --- a/source3/passdb/pdb_ldap.c +++ b/source3/passdb/pdb_ldap.c @@ -3564,6 +3564,7 @@ static NTSTATUS ldapsam_del_aliasmem(struct pdb_methods *methods, static NTSTATUS ldapsam_enum_aliasmem(struct pdb_methods *methods, const DOM_SID *alias, + TALLOC_CTX *mem_ctx, DOM_SID **pp_members, size_t *p_num_members) { @@ -3656,7 +3657,7 @@ static NTSTATUS ldapsam_enum_aliasmem(struct pdb_methods *methods, if (!string_to_sid(&member, values[i])) continue; - status = add_sid_to_array(NULL, &member, pp_members, + status = add_sid_to_array(mem_ctx, &member, pp_members, &num_members); if (!NT_STATUS_IS_OK(status)) { ldap_value_free(values); diff --git a/source3/passdb/pdb_wbc_sam.c b/source3/passdb/pdb_wbc_sam.c index 9c31a0d75c..ec54d553d1 100644 --- a/source3/passdb/pdb_wbc_sam.c +++ b/source3/passdb/pdb_wbc_sam.c @@ -366,8 +366,10 @@ static NTSTATUS pdb_wbc_sam_get_aliasinfo(struct pdb_methods *methods, } static NTSTATUS pdb_wbc_sam_enum_aliasmem(struct pdb_methods *methods, - const DOM_SID *alias, DOM_SID **pp_members, - size_t *p_num_members) + const DOM_SID *alias, + TALLOC_CTX *mem_ctx, + DOM_SID **pp_members, + size_t *p_num_members) { return NT_STATUS_NOT_IMPLEMENTED; } diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c index fba1fc6fa1..da649f98d9 100644 --- a/source3/rpc_server/srv_samr_nt.c +++ b/source3/rpc_server/srv_samr_nt.c @@ -5265,7 +5265,8 @@ NTSTATUS _samr_GetMembersInAlias(pipes_struct *p, DEBUG(10, ("sid is %s\n", sid_string_dbg(&ainfo->sid))); become_root(); - status = pdb_enum_aliasmem(&ainfo->sid, &pdb_sids, &num_sids); + status = pdb_enum_aliasmem(&ainfo->sid, talloc_tos(), &pdb_sids, + &num_sids); unbecome_root(); if (!NT_STATUS_IS_OK(status)) { diff --git a/source3/utils/net_groupmap.c b/source3/utils/net_groupmap.c index 061ffea029..a00784e133 100644 --- a/source3/utils/net_groupmap.c +++ b/source3/utils/net_groupmap.c @@ -732,7 +732,8 @@ static int net_groupmap_listmem(struct net_context *c, int argc, const char **ar members = NULL; num = 0; - if (!NT_STATUS_IS_OK(pdb_enum_aliasmem(&alias, &members, &num))) { + if (!NT_STATUS_IS_OK(pdb_enum_aliasmem(&alias, talloc_tos(), + &members, &num))) { d_fprintf(stderr, "Could not list members for sid %s\n", argv[0]); return -1; } diff --git a/source3/utils/net_sam.c b/source3/utils/net_sam.c index 45dfb61cef..5f41f21aaa 100644 --- a/source3/utils/net_sam.c +++ b/source3/utils/net_sam.c @@ -1233,7 +1233,8 @@ static int net_sam_listmem(struct net_context *c, int argc, const char **argv) DOM_SID *members = NULL; size_t i, num_members = 0; - status = pdb_enum_aliasmem(&group, &members, &num_members); + status = pdb_enum_aliasmem(&group, talloc_tos(), &members, + &num_members); if (!NT_STATUS_IS_OK(status)) { d_fprintf(stderr, "Listing group members failed with " diff --git a/source3/winbindd/winbindd_group.c b/source3/winbindd/winbindd_group.c index e31a55b0cf..4db2c56b8f 100644 --- a/source3/winbindd/winbindd_group.c +++ b/source3/winbindd/winbindd_group.c @@ -157,8 +157,8 @@ static bool fill_passdb_alias_grmem(struct winbindd_domain *domain, *gr_mem = NULL; *gr_mem_len = 0; - if (!NT_STATUS_IS_OK(pdb_enum_aliasmem(group_sid, &members, - &num_members))) + if (!NT_STATUS_IS_OK(pdb_enum_aliasmem(group_sid, talloc_tos(), + &members, &num_members))) return True; for (i=0; i<num_members; i++) { |