diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2012-03-30 21:15:30 +0200 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2012-04-05 15:22:00 -0700 |
commit | 5ee1287ca6c4105a3f659d62dbd8064c7c280bf8 (patch) | |
tree | 726138ff8cf162b767a7d7d982c61182443edf93 /src | |
parent | b0da77f315ccf7e21e7034ff67f64a2b511c4a75 (diff) | |
download | sssd-5ee1287ca6c4105a3f659d62dbd8064c7c280bf8.tar.gz sssd-5ee1287ca6c4105a3f659d62dbd8064c7c280bf8.tar.xz sssd-5ee1287ca6c4105a3f659d62dbd8064c7c280bf8.zip |
Catch cases where D-Bus connection is NULL
https://fedorahosted.org/sssd/ticket/1270
Diffstat (limited to 'src')
-rw-r--r-- | src/providers/data_provider_be.c | 20 | ||||
-rw-r--r-- | src/sbus/sssd_dbus_connection.c | 4 |
2 files changed, 24 insertions, 0 deletions
diff --git a/src/providers/data_provider_be.c b/src/providers/data_provider_be.c index 46c7c218c..c38733225 100644 --- a/src/providers/data_provider_be.c +++ b/src/providers/data_provider_be.c @@ -349,6 +349,11 @@ static void acctinfo_callback(struct be_req *req, } dbus_conn = sbus_get_connection(req->becli->conn); + if (!dbus_conn) { + DEBUG(SSSDBG_CRIT_FAILURE, ("D-BUS not connected\n")); + return; + } + dbus_connection_send(dbus_conn, reply, NULL); dbus_message_unref(reply); @@ -592,6 +597,11 @@ static void be_pam_handler_callback(struct be_req *req, } dbus_conn = sbus_get_connection(req->becli->conn); + if (!dbus_conn) { + DEBUG(SSSDBG_CRIT_FAILURE, ("D-BUS not connected\n")); + return; + } + dbus_connection_send(dbus_conn, reply, NULL); dbus_message_unref(reply); @@ -751,6 +761,11 @@ static void be_sudo_handler_reply(struct sbus_connection *conn, dp_err, dp_ret, errstr ? errstr : "<NULL>")); dbus_conn = sbus_get_connection(conn); + if (!dbus_conn) { + DEBUG(SSSDBG_CRIT_FAILURE, ("D-BUS not connected\n")); + return; + } + dbus_connection_send(dbus_conn, reply, NULL); dbus_message_unref(reply); } @@ -1139,6 +1154,11 @@ static void be_autofs_handler_callback(struct be_req *req, } dbus_conn = sbus_get_connection(req->becli->conn); + if (!dbus_conn) { + DEBUG(SSSDBG_CRIT_FAILURE, ("D-BUS not connected\n")); + return; + } + dbus_connection_send(dbus_conn, reply, NULL); dbus_message_unref(reply); diff --git a/src/sbus/sssd_dbus_connection.c b/src/sbus/sssd_dbus_connection.c index 9faf3d9f7..9077b81c1 100644 --- a/src/sbus/sssd_dbus_connection.c +++ b/src/sbus/sssd_dbus_connection.c @@ -707,6 +707,10 @@ int sbus_conn_send(struct sbus_connection *conn, dbus_bool_t dbret; dbus_conn = sbus_get_connection(conn); + if (!dbus_conn) { + DEBUG(SSSDBG_CRIT_FAILURE, ("D-BUS not connected\n")); + return ENOTCONN; + } dbret = dbus_connection_send_with_reply(dbus_conn, msg, &pending_reply, |