From: Ralph Boehme Date: Thu, 27 Dec 2018 11:48:30 +0000 (+0100) Subject: Revert "s3:messages: protect against usage of wrapper tevent_context objects for... X-Git-Tag: samba-4.9.12~51 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2627724e1b2bba9f814c4a7dd767b878d5371291;p=thirdparty%2Fsamba.git Revert "s3:messages: protect against usage of wrapper tevent_context objects for messaging" This reverts commit 7f2afc20e1b6397c364a98d1be006377c95e4665. See the discussion in https://lists.samba.org/archive/samba-technical/2018-December/131731.html for the reasoning behind this revert. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14033 Signed-off-by: Ralph Boehme Reviewed-by: Volker Lendecke Reviewed-by: Stefan Metzmacher (cherry picked from commit 2a62a98f5c7107f2f83c0bfc2892243d83e2c88a) Autobuild-User(v4-9-test): Karolin Seeger Autobuild-Date(v4-9-test): Thu Aug 8 11:20:26 UTC 2019 on sn-devel-144 --- diff --git a/source3/lib/messages.c b/source3/lib/messages.c index 319a55e3da3..df7af2e50f1 100644 --- a/source3/lib/messages.c +++ b/source3/lib/messages.c @@ -365,11 +365,6 @@ static bool messaging_alert_event_contexts(struct messaging_context *ctx) * alternatively would be to track whether the * immediate has already been scheduled. For * now, avoid that complexity here. - * - * reg->ev and ctx->event_ctx can't - * be wrapper tevent_context pointers - * so we don't need to use - * tevent_context_same_loop(). */ if (reg->ev == ctx->event_ctx) { @@ -498,12 +493,6 @@ static NTSTATUS messaging_init_internal(TALLOC_CTX *mem_ctx, sec_init(); - if (tevent_context_is_wrapper(ev)) { - /* This is really a programmer error! */ - DBG_ERR("Should not be used with a wrapper tevent context\n"); - return NT_STATUS_INVALID_PARAMETER; - } - lck_path = lock_path("msg.lock"); if (lck_path == NULL) { return NT_STATUS_NO_MEMORY; @@ -1025,13 +1014,6 @@ struct tevent_req *messaging_filtered_read_send( state->filter = filter; state->private_data = private_data; - if (tevent_context_is_wrapper(ev)) { - /* This is really a programmer error! */ - DBG_ERR("Wrapper tevent context doesn't use main context.\n"); - tevent_req_error(req, EINVAL); - return tevent_req_post(req, ev); - } - /* * We have to defer the callback here, as we might be called from * within a different tevent_context than state->ev @@ -1352,11 +1334,6 @@ static void messaging_dispatch_rec(struct messaging_context *msg_ctx, bool consumed; size_t i; - /* - * ev and msg_ctx->event_ctx can't be wrapper tevent_context pointers - * so we don't need to use tevent_context_same_loop(). - */ - if (ev == msg_ctx->event_ctx) { consumed = messaging_dispatch_classic(msg_ctx, rec); if (consumed) { diff --git a/source3/lib/messages_ctdb.c b/source3/lib/messages_ctdb.c index a1aeb37af19..d3e2e3f8589 100644 --- a/source3/lib/messages_ctdb.c +++ b/source3/lib/messages_ctdb.c @@ -209,14 +209,6 @@ struct messaging_ctdb_fde *messaging_ctdb_register_tevent_context( return NULL; } - if (tevent_context_is_wrapper(ev)) { - /* - * This is really a programmer error! - */ - DBG_ERR("Should not be used with a wrapper tevent context\n"); - return NULL; - } - fde = talloc(mem_ctx, struct messaging_ctdb_fde); if (fde == NULL) { return NULL; diff --git a/source3/lib/messages_ctdb_ref.c b/source3/lib/messages_ctdb_ref.c index 47b4b758dac..3570ed8ae4c 100644 --- a/source3/lib/messages_ctdb_ref.c +++ b/source3/lib/messages_ctdb_ref.c @@ -52,18 +52,6 @@ void *messaging_ctdb_ref(TALLOC_CTX *mem_ctx, struct tevent_context *ev, { struct msg_ctdb_ref *result, *tmp_refs; - if (tevent_context_is_wrapper(ev)) { - /* - * This is really a programmer error! - * - * The main/raw tevent context should - * have been registered first! - */ - DBG_ERR("Should not be used with a wrapper tevent context\n"); - *err = EINVAL; - return NULL; - } - result = talloc(mem_ctx, struct msg_ctdb_ref); if (result == NULL) { *err = ENOMEM; diff --git a/source3/lib/messages_dgm.c b/source3/lib/messages_dgm.c index 60ac9988db7..72b330eadb1 100644 --- a/source3/lib/messages_dgm.c +++ b/source3/lib/messages_dgm.c @@ -993,12 +993,6 @@ int messaging_dgm_init(struct tevent_context *ev, return EEXIST; } - if (tevent_context_is_wrapper(ev)) { - /* This is really a programmer error! */ - DBG_ERR("Should not be used with a wrapper tevent context\n"); - return EINVAL; - } - ctx = talloc_zero(NULL, struct messaging_dgm_context); if (ctx == NULL) { goto fail_nomem; @@ -1695,14 +1689,6 @@ struct messaging_dgm_fde *messaging_dgm_register_tevent_context( return NULL; } - if (tevent_context_is_wrapper(ev)) { - /* - * This is really a programmer error! - */ - DBG_ERR("Should not be used with a wrapper tevent context\n"); - return NULL; - } - fde = talloc(mem_ctx, struct messaging_dgm_fde); if (fde == NULL) { return NULL; diff --git a/source3/lib/messages_dgm_ref.c b/source3/lib/messages_dgm_ref.c index fd170961746..470dfbeabc7 100644 --- a/source3/lib/messages_dgm_ref.c +++ b/source3/lib/messages_dgm_ref.c @@ -55,18 +55,6 @@ void *messaging_dgm_ref(TALLOC_CTX *mem_ctx, struct tevent_context *ev, { struct msg_dgm_ref *result, *tmp_refs; - if (tevent_context_is_wrapper(ev)) { - /* - * This is really a programmer error! - * - * The main/raw tevent context should - * have been registered first! - */ - DBG_ERR("Should not be used with a wrapper tevent context\n"); - *err = EINVAL; - return NULL; - } - result = talloc(mem_ctx, struct msg_dgm_ref); if (result == NULL) { *err = ENOMEM;