]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:rpc_server: Implement association group find callback
authorSamuel Cabrero <scabrero@samba.org>
Fri, 4 Oct 2019 12:05:53 +0000 (14:05 +0200)
committerSamuel Cabrero <scabrero@sn-devel-184>
Fri, 20 Mar 2020 15:36:33 +0000 (15:36 +0000)
Keep the s3 server behaviour for now and return always the same
association group ID, 0x53F0.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
selftest/knownfail
source3/rpc_server/rpc_server.c

index d7c20eb5ca6124ce227ff4858ec1a4ad79977e65..5eb410e81872ad1aa78eb17270091ec1451dc817 100644 (file)
 ^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
index eeda8e3f38048c6894ae03e691c14a1d1f9c472c..ca6f61c332f5b2216a1d539b029c21a5b431a09b 100644 (file)
@@ -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: */