summaryrefslogtreecommitdiff
path: root/source4/rpc_server/samr
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-08-25 07:32:18 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:16:45 -0500
commitb21b119cbcff175453173d7061e3be3888dc8ec3 (patch)
treea83ace4202a076adc4cdbcf772c4da2ba82fdcf5 /source4/rpc_server/samr
parent0fd98079425cff37c45be824ffa2695458ff12f3 (diff)
downloadsamba-b21b119cbcff175453173d7061e3be3888dc8ec3.tar.gz
samba-b21b119cbcff175453173d7061e3be3888dc8ec3.tar.bz2
samba-b21b119cbcff175453173d7061e3be3888dc8ec3.zip
r17824: add a wrapper for the common partitions_basedn calculation
(This used to be commit 09007b0907662a0d147e8eb21d5bdfc90dbffefc)
Diffstat (limited to 'source4/rpc_server/samr')
-rw-r--r--source4/rpc_server/samr/dcesrv_samr.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source4/rpc_server/samr/dcesrv_samr.c b/source4/rpc_server/samr/dcesrv_samr.c
index 65a1491a1d..abbcb4818c 100644
--- a/source4/rpc_server/samr/dcesrv_samr.c
+++ b/source4/rpc_server/samr/dcesrv_samr.c
@@ -225,7 +225,7 @@ static NTSTATUS samr_LookupDomain(struct dcesrv_call_state *dce_call, TALLOC_CTX
struct ldb_message **dom_msgs;
struct ldb_message **ref_msgs;
int ret;
- const struct ldb_dn *partitions_basedn = ldb_dn_string_compose(mem_ctx, samdb_base_dn(mem_ctx), "CN=Partitions,CN=Configuration");
+ const struct ldb_dn *partitions_basedn;
r->out.sid = NULL;
@@ -237,6 +237,8 @@ static NTSTATUS samr_LookupDomain(struct dcesrv_call_state *dce_call, TALLOC_CTX
return NT_STATUS_INVALID_PARAMETER;
}
+ partitions_basedn = samdb_partitions_dn(c_state->sam_ctx, mem_ctx);
+
if (strcasecmp(r->in.domain_name->string, "BUILTIN") == 0) {
ret = gendb_search(c_state->sam_ctx,
mem_ctx, NULL, &dom_msgs, dom_attrs,
@@ -289,7 +291,7 @@ static NTSTATUS samr_EnumDomains(struct dcesrv_call_state *dce_call, TALLOC_CTX
const char * const ref_attrs[] = { "nETBIOSName", NULL};
struct ldb_message **dom_msgs;
struct ldb_message **ref_msgs;
- const struct ldb_dn *partitions_basedn = ldb_dn_string_compose(mem_ctx, samdb_base_dn(mem_ctx), "CN=Partitions,CN=Configuration");
+ const struct ldb_dn *partitions_basedn;
*r->out.resume_handle = 0;
r->out.sam = NULL;
@@ -299,6 +301,8 @@ static NTSTATUS samr_EnumDomains(struct dcesrv_call_state *dce_call, TALLOC_CTX
c_state = h->data;
+ partitions_basedn = samdb_partitions_dn(c_state->sam_ctx, mem_ctx);
+
count = gendb_search(c_state->sam_ctx,
mem_ctx, NULL, &dom_msgs, dom_attrs,
"(objectClass=domain)");
@@ -367,7 +371,7 @@ static NTSTATUS samr_OpenDomain(struct dcesrv_call_state *dce_call, TALLOC_CTX *
struct ldb_message **dom_msgs;
struct ldb_message **ref_msgs;
int ret;
- const struct ldb_dn *partitions_basedn = ldb_dn_string_compose(mem_ctx, samdb_base_dn(mem_ctx), "CN=Partitions,CN=Configuration");
+ const struct ldb_dn *partitions_basedn;
ZERO_STRUCTP(r->out.domain_handle);
@@ -379,6 +383,8 @@ static NTSTATUS samr_OpenDomain(struct dcesrv_call_state *dce_call, TALLOC_CTX *
return NT_STATUS_INVALID_PARAMETER;
}
+ partitions_basedn = samdb_partitions_dn(c_state->sam_ctx, mem_ctx);
+
ret = gendb_search(c_state->sam_ctx,
mem_ctx, NULL, &dom_msgs, dom_attrs,
"(&(objectSid=%s)(&(objectclass=domain)))",