summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-11-06 18:18:44 +0100
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-11-06 18:07:57 +0000
commit9ff8428c6f5f965c0811218d0f202bdceb1f1a0f (patch)
treea0acc17d6b493836f77c3a2ef389a4fae6bc307f
parent0980a3471ed8fcc3a37296857285dc0235e0e0d2 (diff)
downloadsamba-9ff8428c6f5f965c0811218d0f202bdceb1f1a0f.tar.gz
samba-9ff8428c6f5f965c0811218d0f202bdceb1f1a0f.tar.bz2
samba-9ff8428c6f5f965c0811218d0f202bdceb1f1a0f.zip
s4:samr RPC server - "dcesrv_samr_RemoveMemberFromForeignDomain"
- Remove TODO comment: MS-SAMR 3.1.5.8.7 explicitly states: "The SamrRemoveMemberFromForeignDomain method removes a member from all aliases." - Remove the search attributes since they aren't strictly needed. Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org> Autobuild-Date: Sat Nov 6 18:07:57 UTC 2010 on sn-devel-104
-rw-r--r--source4/rpc_server/samr/dcesrv_samr.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/source4/rpc_server/samr/dcesrv_samr.c b/source4/rpc_server/samr/dcesrv_samr.c
index dbc9c1e245..391bc7fcb0 100644
--- a/source4/rpc_server/samr/dcesrv_samr.c
+++ b/source4/rpc_server/samr/dcesrv_samr.c
@@ -3890,14 +3890,15 @@ static NTSTATUS dcesrv_samr_GetUserPwInfo(struct dcesrv_call_state *dce_call, TA
/*
samr_RemoveMemberFromForeignDomain
*/
-static NTSTATUS dcesrv_samr_RemoveMemberFromForeignDomain(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
- struct samr_RemoveMemberFromForeignDomain *r)
+static NTSTATUS dcesrv_samr_RemoveMemberFromForeignDomain(struct dcesrv_call_state *dce_call,
+ TALLOC_CTX *mem_ctx,
+ struct samr_RemoveMemberFromForeignDomain *r)
{
struct dcesrv_handle *h;
struct samr_domain_state *d_state;
const char *memberdn;
struct ldb_message **res;
- const char * const attrs[3] = { "distinguishedName", "objectSid", NULL };
+ const char *no_attrs[] = { NULL };
int i, count;
DCESRV_PULL_HANDLE(h, r->in.domain_handle, SAMR_HANDLE_DOMAIN);
@@ -3912,11 +3913,8 @@ static NTSTATUS dcesrv_samr_RemoveMemberFromForeignDomain(struct dcesrv_call_sta
return NT_STATUS_OK;
}
- /* TODO: Does this call only remove alias members, or does it do this
- * for domain groups as well? */
-
count = samdb_search_domain(d_state->sam_ctx, mem_ctx,
- d_state->domain_dn, &res, attrs,
+ d_state->domain_dn, &res, no_attrs,
d_state->domain_sid,
"(&(member=%s)(objectClass=group)"
"(|(groupType=%d)(groupType=%d)))",
@@ -3935,11 +3933,7 @@ static NTSTATUS dcesrv_samr_RemoveMemberFromForeignDomain(struct dcesrv_call_sta
return NT_STATUS_NO_MEMORY;
}
- mod->dn = samdb_result_dn(d_state->sam_ctx, mod, res[i], "distinguishedName", NULL);
- if (mod->dn == NULL) {
- talloc_free(mod);
- continue;
- }
+ mod->dn = res[i]->dn;
if (samdb_msg_add_delval(d_state->sam_ctx, mem_ctx, mod,
"member", memberdn) != LDB_SUCCESS)