diff options
author | Stefan Metzmacher <metze@samba.org> | 2008-10-01 06:28:32 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2009-09-08 22:05:56 +0200 |
commit | 5ef601e5eb793e5807d8171b7a3e0d6cc327a371 (patch) | |
tree | ad7baf5b46e527f75b5b29283b3935af1405718b /source4/rpc_server | |
parent | f78f92acfe2710f9f3ff11f9acea8c240f6cc5e6 (diff) | |
download | samba-5ef601e5eb793e5807d8171b7a3e0d6cc327a371.tar.gz samba-5ef601e5eb793e5807d8171b7a3e0d6cc327a371.tar.bz2 samba-5ef601e5eb793e5807d8171b7a3e0d6cc327a371.zip |
s4:drsuapi: add an incomplete DsAddEntry implementation
metze
Diffstat (limited to 'source4/rpc_server')
-rw-r--r-- | source4/rpc_server/drsuapi/dcesrv_drsuapi.c | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/source4/rpc_server/drsuapi/dcesrv_drsuapi.c b/source4/rpc_server/drsuapi/dcesrv_drsuapi.c index 30096f199e..991b39984b 100644 --- a/source4/rpc_server/drsuapi/dcesrv_drsuapi.c +++ b/source4/rpc_server/drsuapi/dcesrv_drsuapi.c @@ -966,14 +966,49 @@ static WERROR dcesrv_drsuapi_DsGetDomainControllerInfo(struct dcesrv_call_state return WERR_UNKNOWN_LEVEL; } - /* drsuapi_DsAddEntry */ static WERROR dcesrv_drsuapi_DsAddEntry(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct drsuapi_DsAddEntry *r) { - DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR); + WERROR status; + struct drsuapi_bind_state *b_state; + struct dcesrv_handle *h; + uint32_t num = 0; + struct drsuapi_DsReplicaObjectIdentifier2 *ids = NULL; + + /* TODO: check which out level the client supports */ + + ZERO_STRUCTP(r->out.ctr); + r->out.level_out = 3; + r->out.ctr->ctr3.level = 1; + r->out.ctr->ctr3.error = talloc_zero(mem_ctx, union drsuapi_DsAddEntryError); + + DCESRV_PULL_HANDLE_WERR(h, r->in.bind_handle, DRSUAPI_BIND_HANDLE); + b_state = h->data; + + switch (r->in.level) { + case 2: + status = dsdb_origin_objects_commit(b_state->sam_ctx, + mem_ctx, + &r->in.req->req2.first_object, + &num, + &ids); + if (!W_ERROR_IS_OK(status)) { + r->out.ctr->ctr3.error->info1.status = status; + W_ERROR_NOT_OK_RETURN(status); + } + + r->out.ctr->ctr3.count = num; + r->out.ctr->ctr3.objects = ids; + + return WERR_OK; + default: + break; + } + + return WERR_FOOBAR; } |