From c038a4e9c09ba4ac77d885ac0afee418f41b8891 Mon Sep 17 00:00:00 2001 From: bubulle Date: Tue, 6 Apr 2010 18:12:47 +0000 Subject: Revert to 3.4.7...for now? git-svn-id: svn://svn.debian.org/svn/pkg-samba/trunk/samba@3416 fc4039ab-9d04-0410-8cac-899223bdd6b0 --- source3/groupdb/mapping.c | 7 +++---- source3/groupdb/mapping.h | 3 +-- source3/groupdb/mapping_ldb.c | 15 +++++++-------- source3/groupdb/mapping_tdb.c | 7 ++----- 4 files changed, 13 insertions(+), 19 deletions(-) (limited to 'source3/groupdb') diff --git a/source3/groupdb/mapping.c b/source3/groupdb/mapping.c index 12d0bd365c..4f05d732f1 100644 --- a/source3/groupdb/mapping.c +++ b/source3/groupdb/mapping.c @@ -606,15 +606,14 @@ 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 DOM_SID *alias, 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, mem_ctx, pp_members, - p_num_members); + return backend->enum_aliasmem(alias, 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 519b0ae08a..c37ae84b87 100644 --- a/source3/groupdb/mapping.h +++ b/source3/groupdb/mapping.h @@ -29,6 +29,5 @@ 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, TALLOC_CTX *mem_ctx, - DOM_SID **sids, size_t *num); + NTSTATUS (*enum_aliasmem)(const DOM_SID *alias, DOM_SID **sids, size_t *num); }; diff --git a/source3/groupdb/mapping_ldb.c b/source3/groupdb/mapping_ldb.c index 89966e1986..6bdbe59212 100644 --- a/source3/groupdb/mapping_ldb.c +++ b/source3/groupdb/mapping_ldb.c @@ -23,7 +23,7 @@ #include "includes.h" #include "groupdb/mapping.h" -#include "lib/ldb/include/ldb.h" +#include "lib/ldb/include/includes.h" #include "lib/ldb/include/ldb_errors.h" static struct ldb_context *ldb; @@ -57,7 +57,7 @@ static bool init_group_mapping(void) db_path = state_path("group_mapping.ldb"); - ldb = ldb_init(NULL, NULL); + ldb = ldb_init(NULL); if (ldb == NULL) goto failed; /* Ensure this db is created read/write for root only. */ @@ -133,8 +133,8 @@ static struct ldb_dn *mapping_dn(TALLOC_CTX *mem_ctx, const DOM_SID *sid) } /* we split by domain and rid so we can do a subtree search when we only want one domain */ - return ldb_dn_new_fmt(mem_ctx, ldb, "rid=%u,domain=%s", - rid, string_sid); + return ldb_dn_string_compose(mem_ctx, NULL, "rid=%u,domain=%s", + rid, string_sid); } /* @@ -328,7 +328,7 @@ static bool enum_group_mapping(const DOM_SID *domsid, enum lsa_SidType sid_name_ /* we do a subtree search on the domain */ if (domsid != NULL) { sid_to_fstring(name, domsid); - basedn = ldb_dn_new_fmt(tmp_ctx, ldb, "domain=%s", name); + basedn = ldb_dn_string_compose(tmp_ctx, NULL, "domain=%s", name); if (basedn == NULL) goto failed; } @@ -488,8 +488,7 @@ 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, TALLOC_CTX *mem_ctx, - DOM_SID **sids, size_t *num) +static NTSTATUS enum_aliasmem(const DOM_SID *alias, DOM_SID **sids, size_t *num) { const char *attrs[] = { "member", @@ -530,7 +529,7 @@ static NTSTATUS enum_aliasmem(const DOM_SID *alias, TALLOC_CTX *mem_ctx, for (i=0;inum_values;i++) { DOM_SID sid; string_to_sid(&sid, (const char *)el->values[i].data); - status = add_sid_to_array_unique(mem_ctx, &sid, sids, num); + status = add_sid_to_array_unique(NULL, &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 8498f0c821..29927eb592 100644 --- a/source3/groupdb/mapping_tdb.c +++ b/source3/groupdb/mapping_tdb.c @@ -535,7 +535,6 @@ 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; @@ -581,7 +580,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(state->mem_ctx, &member, + if (!NT_STATUS_IS_OK(add_sid_to_array(NULL, &member, state->sids, state->num))) { @@ -594,8 +593,7 @@ 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 DOM_SID *alias, DOM_SID **sids, size_t *num) { GROUP_MAP map; struct aliasmem_state state; @@ -613,7 +611,6 @@ static NTSTATUS enum_aliasmem(const DOM_SID *alias, TALLOC_CTX *mem_ctx, 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; -- cgit v1.2.3