summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2015-08-07 17:13:02 +0200
committerJakub Hrozek <jhrozek@redhat.com>2015-09-01 09:59:54 +0200
commit7209bd420f5ee2053ae9f404477cacea77491af8 (patch)
treea349c97738bee29b94aaa7afdf293179d108a358
parent70c8542ec28650da1217ef242cc848db03d1ba7d (diff)
downloadsssd-bycert.zip
sssd-bycert.tar.gz
sssd-bycert.tar.xz
sbus: Add a special error code for messages sent by the bus itselfbycert
-rw-r--r--src/sbus/sssd_dbus_request.c5
-rw-r--r--src/sbus/sssd_dbus_signals.c4
-rw-r--r--src/util/util_errors.c1
-rw-r--r--src/util/util_errors.h1
4 files changed, 10 insertions, 1 deletions
diff --git a/src/sbus/sssd_dbus_request.c b/src/sbus/sssd_dbus_request.c
index 888a0ee..552bb5d 100644
--- a/src/sbus/sssd_dbus_request.c
+++ b/src/sbus/sssd_dbus_request.c
@@ -327,6 +327,11 @@ struct tevent_req *sbus_get_sender_id_send(TALLOC_CTX *mem_ctx,
goto immediate;
}
+ if (strcmp(sender, "org.freedesktop.DBus") == 0) {
+ ret = ERR_SBUS_SENDER_BUS;
+ goto immediate;
+ }
+
state->sender = talloc_strdup(state, sender);
if (state->sender == NULL) {
ret = ENOMEM;
diff --git a/src/sbus/sssd_dbus_signals.c b/src/sbus/sssd_dbus_signals.c
index 5ecc9f1..1dc08ae 100644
--- a/src/sbus/sssd_dbus_signals.c
+++ b/src/sbus/sssd_dbus_signals.c
@@ -267,7 +267,9 @@ sbus_signal_handler_got_caller_id(struct tevent_req *req)
signal = tevent_req_callback_data(req, struct sbus_incoming_signal);
ret = sbus_get_sender_id_recv(req, &signal->client);
- if (ret != EOK) {
+ if (ret == ERR_SBUS_SENDER_BUS) {
+ DEBUG(SSSDBG_TRACE_FUNC, "Got a signal from the bus..\n");
+ } else if (ret != EOK) {
DEBUG(SSSDBG_CRIT_FAILURE,
"Failed to resolve caller's ID: %s\n", sss_strerror(ret));
goto done;
diff --git a/src/util/util_errors.c b/src/util/util_errors.c
index ba61630..fd6b9fb 100644
--- a/src/util/util_errors.c
+++ b/src/util/util_errors.c
@@ -80,6 +80,7 @@ struct err_string error_to_str[] = {
{ "Trusted forest root unknown" }, /* ERR_TRUST_FOREST_UNKNOWN */
{ "p11_child failed" }, /* ERR_P11_CHILD */
{ "Address family not supported" }, /* ERR_ADDR_FAMILY_NOT_SUPPORTED */
+ { "Message sender is the bus" }, /* ERR_SBUS_SENDER_BUS */
{ "ERR_LAST" } /* ERR_LAST */
};
diff --git a/src/util/util_errors.h b/src/util/util_errors.h
index aa00cc5..bda0c9b 100644
--- a/src/util/util_errors.h
+++ b/src/util/util_errors.h
@@ -102,6 +102,7 @@ enum sssd_errors {
ERR_TRUST_FOREST_UNKNOWN,
ERR_P11_CHILD,
ERR_ADDR_FAMILY_NOT_SUPPORTED,
+ ERR_SBUS_SENDER_BUS,
ERR_LAST /* ALWAYS LAST */
};