^samba.tests.dcerpc.raw_protocol.*.TestDCERPC_BIND.test_no_auth_presentation_ctx_invalid4
^samba.tests.dcerpc.raw_protocol.*.TestDCERPC_BIND.test_spnego_change_auth_type2
^samba.tests.dcerpc.raw_protocol.*.TestDCERPC_BIND.test_spnego_change_transfer
-# Association groups not implemented yet in s3 server implementation
+# Association groups between processes not implemented yet in s3 server implementation
+^samba.tests.dcerpc.raw_protocol.*.TestDCERPC_BIND.test_assoc_group_ok2\(ad_member\)
^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
TALLOC_FREE(frame);
}
-static NTSTATUS dcesrv_assoc_group_new(struct dcesrv_call_state *call,
- uint32_t assoc_group_id)
+static int dcesrv_assoc_group_destructor(struct dcesrv_assoc_group *assoc_group)
+{
+ int ret;
+ ret = idr_remove(assoc_group->dce_ctx->assoc_groups_idr,
+ assoc_group->id);
+ if (ret != 0) {
+ DBG_ERR("Failed to remove assoc_group 0x%08x\n",
+ assoc_group->id);
+ }
+ return 0;
+}
+
+static NTSTATUS dcesrv_assoc_group_new(struct dcesrv_call_state *call)
{
struct dcesrv_connection *conn = call->conn;
struct dcesrv_context *dce_ctx = conn->dce_ctx;
enum dcerpc_transport_t transport =
dcerpc_binding_get_transport(endpoint->ep_description);
struct dcesrv_assoc_group *assoc_group = NULL;
+ int id;
assoc_group = talloc_zero(conn, struct dcesrv_assoc_group);
if (assoc_group == NULL) {
return NT_STATUS_NO_MEMORY;
}
+ id = idr_get_new_random(dce_ctx->assoc_groups_idr,
+ assoc_group,
+ UINT16_MAX);
+ if (id == -1) {
+ TALLOC_FREE(assoc_group);
+ DBG_ERR("Out of association groups!\n");
+ return NT_STATUS_RPC_OUT_OF_RESOURCES;
+ }
+
assoc_group->transport = transport;
- assoc_group->id = assoc_group_id;
+ assoc_group->id = id;
assoc_group->dce_ctx = dce_ctx;
call->conn->assoc_group = assoc_group;
+ talloc_set_destructor(assoc_group, dcesrv_assoc_group_destructor);
+
return NT_STATUS_OK;
}
DBG_NOTICE("Failed to find assoc_group 0x%08x in this "
"server process, creating a new one\n",
assoc_group_id);
- return dcesrv_assoc_group_new(call, assoc_group_id);
+ return dcesrv_assoc_group_new(call);
}
assoc_group = talloc_get_type_abort(id_ptr, struct dcesrv_assoc_group);
}
/* If not requested by client create a new association group */
- return dcesrv_assoc_group_new(call, 0x53F0);
+ return dcesrv_assoc_group_new(call);
}
void dcesrv_transport_terminate_connection(struct dcesrv_connection *dce_conn,