I prepared this patch as a part of [1]. I provided the reported a gdb
script to help localize the code where we mess up with hostid data, but
the reporter does not see the issue any more, thus I'm sending the
patch separately.

It is definitely not a solution for #1751, but at least sssd will not crash. Similar check is also present in other be handlers.

[1] https://fedorahosted.org/sssd/ticket/1751
From 1d59f6427282cc2c77fa12a1470f3d400285a7ef Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <[email protected]>
Date: Thu, 17 Jan 2013 17:40:04 +0100
Subject: [PATCH] dp: check whether hostid backend is configured before filing
 be request

---
 src/providers/data_provider_be.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/providers/data_provider_be.c b/src/providers/data_provider_be.c
index ec492b8a26a208820657dddb7fccf7ff0fc4bda1..0365a80d2de3685d4dc1d1811be6e2a6eae01bd2 100644
--- a/src/providers/data_provider_be.c
+++ b/src/providers/data_provider_be.c
@@ -1725,6 +1725,14 @@ static int be_host_handler(DBusMessage *message, struct sbus_connection *conn)
 
     /* process request */
 
+    if (!becli->bectx->bet_info[BET_HOSTID].bet_ops) {
+        DEBUG(SSSDBG_CRIT_FAILURE, ("Undefined backend target.\n"));
+        err_maj = DP_ERR_FATAL;
+        err_min = ENODEV;
+        err_msg = "HostID back end target is not configured";
+        goto done;
+    }
+
     ret = be_file_request(becli->bectx->bet_info[BET_HOSTID].pvt_bet_data,
                           be_req,
                           becli->bectx->bet_info[BET_HOSTID].bet_ops->handler);
-- 
1.7.11.7

_______________________________________________
sssd-devel mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/sssd-devel

Reply via email to