On 06/26/2013 05:32 PM, Lukas Slebodnik wrote:
On (26/06/13 10:49), Pavel Březina wrote:
https://fedorahosted.org/sssd/ticket/1693

The reason why sudo show different messages is that SSSD crashes
(SIGABRT from talloc) when out of band refresh is finished. For some
reason, Nikolai's test is much more likely to reveal this on rhel
systems than on fedora, however the SSSD crashes on both systems.

How to test it:
1. run Nikolai's test attached to bugzilla
2. attach gdb to sssd_sudo and hit continue
3. wait for it

Without the patch, you will receive SIGABRT from talloc. With the
patch, you'll get SIGTERM from the test.

I'd like to get this to both 1.10 and 1.9.

Patch fixes the crash. There is no other place, where
tevent_req_set_callback is called with callback
sudosrv_dp_req_done and last argument NULL.

I have just a question.
There are two callbacks:
     sudosrv_dp_send_acct_req_done
     sudosrv_dp_req_done
with pattern "sudosrv_dp.*_done" and new callback has name
sudosrv_oob_dp_req_done.

Is there any particular reason for this name?

LS

Thanks, I changed it. I also removed the dead code from sudosrv_dp_req_done() - if cb_ctx == NULL then tevent obviously calls abort.

From 7cf261c729287c0862c089e4b881395d95be8768 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrez...@redhat.com>
Date: Wed, 26 Jun 2013 10:31:18 +0200
Subject: [PATCH] sudo responder: use different callback for oob refresh

https://fedorahosted.org/sssd/ticket/1693

Since we don't care about returned values from out of band refresh,
we do not need to set callback data. However, this caused talloc
to abort as it considers it as type mismatch when called from
tevent_req_callback_data().
---
 src/responder/sudo/sudosrv_get_sudorules.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/responder/sudo/sudosrv_get_sudorules.c b/src/responder/sudo/sudosrv_get_sudorules.c
index e84631e3db310f5eea265ea57adcbfb5854e3226..4a121feb340e7ef723ae76179c521174688af9ae 100644
--- a/src/responder/sudo/sudosrv_get_sudorules.c
+++ b/src/responder/sudo/sudosrv_get_sudorules.c
@@ -450,11 +450,6 @@ sudosrv_dp_req_done(struct tevent_req *req)
     dbus_uint32_t err_min;
     char *err_msg;
 
-    if (cb_ctx == NULL) {
-        /* we are not interested in returned values */
-        talloc_free(req);
-        return;
-    }
     cli_ctx = talloc_get_type(cb_ctx->cctx, struct cli_ctx);
 
     ret = sss_dp_get_sudoers_recv(cb_ctx->mem_ctx, req,
@@ -471,6 +466,13 @@ sudosrv_dp_req_done(struct tevent_req *req)
 }
 
 static void
+sudosrv_dp_oob_req_done(struct tevent_req *req)
+{
+    DEBUG(SSSDBG_TRACE_FUNC, ("Out of band refresh finished\n"));
+    talloc_free(req);
+}
+
+static void
 sudosrv_get_sudorules_dp_callback(uint16_t err_maj, uint32_t err_min,
                                   const char *err_msg, void *ptr)
 {
@@ -512,7 +514,7 @@ sudosrv_get_sudorules_dp_callback(uint16_t err_maj, uint32_t err_min,
             DEBUG(SSSDBG_CRIT_FAILURE,
                   ("Cannot issue DP request.\n"));
         } else {
-            tevent_req_set_callback(dpreq, sudosrv_dp_req_done, NULL);
+            tevent_req_set_callback(dpreq, sudosrv_dp_oob_req_done, NULL);
         }
     }
 
-- 
1.7.11.7

_______________________________________________
sssd-devel mailing list
sssd-devel@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/sssd-devel

Reply via email to