summaryrefslogtreecommitdiff
path: root/source4/rpc_server
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2005-08-26 16:12:25 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:34:38 -0500
commit61aaf82b6280292ad29439b15ab3bcde065a4c45 (patch)
treeda46c5b8661d391800e7ef95d52dfe657f9c2c32 /source4/rpc_server
parent44a27265fb2aed8ce976aa6cd5875faaa5aec4d9 (diff)
downloadsamba-61aaf82b6280292ad29439b15ab3bcde065a4c45.tar.gz
samba-61aaf82b6280292ad29439b15ab3bcde065a4c45.tar.bz2
samba-61aaf82b6280292ad29439b15ab3bcde065a4c45.zip
r9654: introduce the samdb_search_dn call
(This used to be commit 333ebb40d55c60465564b894d5028b364e99ee00)
Diffstat (limited to 'source4/rpc_server')
-rw-r--r--source4/rpc_server/lsa/dcesrv_lsa.c22
-rw-r--r--source4/rpc_server/samr/dcesrv_samr.c7
-rw-r--r--source4/rpc_server/samr/samr_password.c14
3 files changed, 15 insertions, 28 deletions
diff --git a/source4/rpc_server/lsa/dcesrv_lsa.c b/source4/rpc_server/lsa/dcesrv_lsa.c
index bac25fcc24..c81eb99a0e 100644
--- a/source4/rpc_server/lsa/dcesrv_lsa.c
+++ b/source4/rpc_server/lsa/dcesrv_lsa.c
@@ -261,18 +261,15 @@ static NTSTATUS lsa_get_policy_state(struct dcesrv_call_state *dce_call, TALLOC_
/* work out the builtin_dn - useful for so many calls its worth
fetching here */
- state->builtin_dn = ldb_dn_explode(state,
- samdb_search_string(state->sam_ldb, mem_ctx, NULL,
- "dn", "objectClass=builtinDomain"));
+ state->builtin_dn = samdb_search_dn(state->sam_ldb, mem_ctx, NULL, "objectClass=builtinDomain");
if (!state->builtin_dn) {
return NT_STATUS_NO_SUCH_DOMAIN;
}
/* work out the system_dn - useful for so many calls its worth
fetching here */
- state->system_dn = ldb_dn_explode(state,
- samdb_search_string(state->sam_ldb, mem_ctx, state->domain_dn,
- "dn", "(&(objectClass=container)(cn=System))"));
+ state->system_dn = samdb_search_dn(state->sam_ldb, mem_ctx,
+ state->domain_dn, "(&(objectClass=container)(cn=System))");
if (!state->system_dn) {
return NT_STATUS_NO_SUCH_DOMAIN;
}
@@ -1304,13 +1301,9 @@ static NTSTATUS lsa_OpenAccount(struct dcesrv_call_state *dce_call, TALLOC_CTX *
}
/* check it really exists */
- astate->account_dn =
- ldb_dn_explode(mem_ctx,
- samdb_search_string(state->sam_ldb, astate,
- NULL, "dn",
- "(&(objectSid=%s)(objectClass=group))",
- ldap_encode_ndr_dom_sid(mem_ctx,
- astate->account_sid)));
+ astate->account_dn = samdb_search_string(state->sam_ldb, astate,
+ NULL, "(&(objectSid=%s)(objectClass=group))",
+ ldap_encode_ndr_dom_sid(mem_ctx, astate->account_sid));
if (astate->account_dn == NULL) {
talloc_free(astate);
return NT_STATUS_NO_SUCH_USER;
@@ -1466,8 +1459,7 @@ static NTSTATUS lsa_AddRemoveAccountRights(struct dcesrv_call_state *dce_call,
return NT_STATUS_NO_MEMORY;
}
- dn = samdb_search_string(state->sam_ldb, mem_ctx, NULL, "dn",
- "objectSid=%s", sidstr);
+ dn = samdb_search_dn(state->sam_ldb, mem_ctx, NULL, "objectSid=%s", sidstr);
if (dn == NULL) {
return NT_STATUS_NO_SUCH_USER;
}
diff --git a/source4/rpc_server/samr/dcesrv_samr.c b/source4/rpc_server/samr/dcesrv_samr.c
index ff15eb43bb..aeea3a120c 100644
--- a/source4/rpc_server/samr/dcesrv_samr.c
+++ b/source4/rpc_server/samr/dcesrv_samr.c
@@ -2117,11 +2117,8 @@ static NTSTATUS samr_AddAliasMember(struct dcesrv_call_state *dce_call, TALLOC_C
* cn=For...,cn=Builtin,dc={BASEDN}. -- vl
*/
- basedn = ldb_dn_explode(mem_ctx,
- samdb_search_string(d_state->sam_ctx,
- mem_ctx, NULL, "dn",
- "(&(objectClass=container)"
- "(cn=ForeignSecurityPrincipals))"));
+ basedn = samdb_search_dn(d_state->sam_ctx, mem_ctx, NULL,
+ "(&(objectClass=container)(cn=ForeignSecurityPrincipals))");
if (basedn == NULL) {
DEBUG(0, ("Failed to find DN for "
diff --git a/source4/rpc_server/samr/samr_password.c b/source4/rpc_server/samr/samr_password.c
index c862763101..ab99b69458 100644
--- a/source4/rpc_server/samr/samr_password.c
+++ b/source4/rpc_server/samr/samr_password.c
@@ -210,10 +210,9 @@ NTSTATUS samr_OemChangePasswordUser2(struct dcesrv_call_state *dce_call, TALLOC_
return NT_STATUS_NO_SUCH_USER;
}
- domain_dn = ldb_dn_explode(mem_ctx,
- samdb_search_string(sam_ctx, mem_ctx, NULL, "dn",
- "(objectSid=%s)",
- ldap_encode_ndr_dom_sid(mem_ctx, domain_sid)));
+ domain_dn = samdb_search_dn(sam_ctx, mem_ctx, NULL,
+ "(objectSid=%s)",
+ ldap_encode_ndr_dom_sid(mem_ctx, domain_sid));
if (!domain_dn) {
return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
@@ -361,10 +360,9 @@ NTSTATUS samr_ChangePasswordUser3(struct dcesrv_call_state *dce_call,
goto failed;
}
- domain_dn = ldb_dn_explode(mem_ctx,
- samdb_search_string(sam_ctx, mem_ctx, NULL, "dn",
- "(objectSid=%s)",
- ldap_encode_ndr_dom_sid(mem_ctx, domain_sid)));
+ domain_dn = samdb_search_dn(sam_ctx, mem_ctx, NULL,
+ "(objectSid=%s)",
+ ldap_encode_ndr_dom_sid(mem_ctx, domain_sid));
if (!domain_dn) {
status = NT_STATUS_INTERNAL_DB_CORRUPTION;
goto failed;