]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Revert "s3:messages: allow messaging_filtered_read_send() to use wrapper tevent_context"
authorRalph Boehme <slow@samba.org>
Thu, 27 Dec 2018 11:45:15 +0000 (12:45 +0100)
committerKarolin Seeger <kseeger@samba.org>
Thu, 8 Aug 2019 07:32:21 +0000 (07:32 +0000)
This reverts commit 2b05f1098187e00166649c8ea7c63e6901b9d242.

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 <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit e2a5272ac6831b407a0c51bb8615252ec68be6a8)

source3/lib/messages.c

index 90fffa2c872e211c6d77c18b03f5950412d4d74e..319a55e3da31a288aa9001b02d9a6a4098cd0ec4 100644 (file)
@@ -206,7 +206,7 @@ static bool messaging_register_event_context(struct messaging_context *ctx,
                        continue;
                }
 
-               if (tevent_context_same_loop(reg->ev, ev)) {
+               if (reg->ev == ev) {
                        reg->refcount += 1;
                        return true;
                }
@@ -255,7 +255,7 @@ static bool messaging_deregister_event_context(struct messaging_context *ctx,
                        continue;
                }
 
-               if (tevent_context_same_loop(reg->ev, ev)) {
+               if (reg->ev == ev) {
                        reg->refcount -= 1;
 
                        if (reg->refcount == 0) {
@@ -1025,9 +1025,7 @@ struct tevent_req *messaging_filtered_read_send(
        state->filter = filter;
        state->private_data = private_data;
 
-       if (tevent_context_is_wrapper(ev) &&
-           !tevent_context_same_loop(ev, msg_ctx->event_ctx))
-       {
+       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);
@@ -1036,11 +1034,7 @@ struct tevent_req *messaging_filtered_read_send(
 
        /*
         * We have to defer the callback here, as we might be called from
-        * within a different tevent_context than state->ev.
-        *
-        * This is important for two cases:
-        * 1. nested event contexts, used by blocking ctdb calls
-        * 2. possible impersonation using wrapper tevent contexts.
+        * within a different tevent_context than state->ev
         */
        tevent_req_defer_callback(req, state->ev);
 
@@ -1336,7 +1330,7 @@ static bool messaging_dispatch_waiters(struct messaging_context *msg_ctx,
 
                state = tevent_req_data(
                        req, struct messaging_filtered_read_state);
-               if (tevent_context_same_loop(ev, state->ev) &&
+               if ((ev == state->ev) &&
                    state->filter(rec, state->private_data)) {
                        messaging_filtered_read_done(req, rec);
                        return true;