From: Samuel Cabrero Date: Fri, 4 Oct 2019 12:05:53 +0000 (+0200) Subject: s3:rpc_server: Implement association group find callback X-Git-Tag: ldb-2.2.0~1341 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e7670ed12886ee6536372ff90c0fd060533e445;p=thirdparty%2Fsamba.git s3:rpc_server: Implement association group find callback Keep the s3 server behaviour for now and return always the same association group ID, 0x53F0. Signed-off-by: Samuel Cabrero Reviewed-by: Andrew Bartlett --- diff --git a/selftest/knownfail b/selftest/knownfail index d7c20eb5ca6..5eb410e8187 100644 --- a/selftest/knownfail +++ b/selftest/knownfail @@ -338,6 +338,11 @@ ^samba.tests.dcerpc.raw_protocol.*.TestDCERPC_BIND.test_spnego_change_auth_type2 ^samba.tests.dcerpc.raw_protocol.*.TestDCERPC_BIND.test_spnego_change_transfer ^samba.tests.dcerpc.raw_protocol.*\(ad_member\) +# Association groups not implemented yet in s3 server implementation +^samba.tests.dcerpc.raw_protocol.*.TestDCERPC_BIND.test_assoc_group_fail1\(ad_member\) +^samba.tests.dcerpc.raw_protocol.*.TestDCERPC_BIND.test_assoc_group_fail2\(ad_member\) +^samba.tests.dcerpc.raw_protocol.*.TestDCERPC_BIND.test_assoc_group_fail3\(ad_member\) +^samba.tests.dcerpc.raw_protocol.*.TestDCERPC_BIND.test_assoc_group_diff1\(ad_member\) ^samba4.rpc.echo.*on.*with.object.echo.doublepointer.*nt4_dc ^samba4.rpc.echo.*on.*with.object.echo.surrounding.*nt4_dc ^samba4.rpc.echo.*on.*with.object.echo.enum.*nt4_dc diff --git a/source3/rpc_server/rpc_server.c b/source3/rpc_server/rpc_server.c index eeda8e3f380..ca6f61c332f 100644 --- a/source3/rpc_server/rpc_server.c +++ b/source3/rpc_server/rpc_server.c @@ -1260,10 +1260,40 @@ void dcesrv_log_successful_authz(struct dcesrv_call_state *call) TALLOC_FREE(frame); } +static NTSTATUS dcesrv_assoc_group_new(struct dcesrv_call_state *call, + uint32_t assoc_group_id) +{ + struct dcesrv_connection *conn = call->conn; + struct dcesrv_context *dce_ctx = conn->dce_ctx; + const struct dcesrv_endpoint *endpoint = conn->endpoint; + enum dcerpc_transport_t transport = + dcerpc_binding_get_transport(endpoint->ep_description); + struct dcesrv_assoc_group *assoc_group = NULL; + + assoc_group = talloc_zero(conn, struct dcesrv_assoc_group); + if (assoc_group == NULL) { + return NT_STATUS_NO_MEMORY; + } + + assoc_group->transport = transport; + assoc_group->id = assoc_group_id; + assoc_group->dce_ctx = dce_ctx; + + call->conn->assoc_group = assoc_group; + + return NT_STATUS_OK; +} + NTSTATUS dcesrv_assoc_group_find(struct dcesrv_call_state *call) { - /* TODO */ - return NT_STATUS_NOT_IMPLEMENTED; + uint32_t assoc_group_id = call->pkt.u.bind.assoc_group_id; + + /* If not requested by client create a new association group */ + if (assoc_group_id == 0) { + assoc_group_id = 0x53F0; + } + + return dcesrv_assoc_group_new(call, assoc_group_id); } /* vim: set ts=8 sw=8 noet cindent syntax=c.doxygen: */