summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2012-03-30 21:15:30 +0200
committerStephen Gallagher <sgallagh@redhat.com>2012-04-09 09:11:40 -0400
commit00770d240fc442c75373ba2a544518c26466ac84 (patch)
tree8721eda9ae0d59c3a1a15e64f99f595a002f856e
parenteaf791e697d5e5ce0bc0f17e0b1b6dbb1d19bfee (diff)
downloadsssd-00770d240fc442c75373ba2a544518c26466ac84.tar.gz
sssd-00770d240fc442c75373ba2a544518c26466ac84.tar.xz
sssd-00770d240fc442c75373ba2a544518c26466ac84.zip
Catch cases where D-Bus connection is NULL
https://fedorahosted.org/sssd/ticket/1270
-rw-r--r--src/providers/data_provider_be.c20
-rw-r--r--src/sbus/sssd_dbus_connection.c4
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,