summaryrefslogtreecommitdiff
path: root/bus/signals.h
diff options
context:
space:
mode:
authorCosimo Alfarano <cosimo.alfarano@collabora.co.uk>2011-07-11 17:03:00 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2011-07-11 17:03:20 +0100
commita940e7b1d1b6b832e2ec732a11f495240156fb31 (patch)
tree55ddc85e3f8b7b9cc4858ab9029ec4ffa96d4c93 /bus/signals.h
parent0ecd0a02b993685a456da58c5c03e2d3bab17d67 (diff)
downloaddbus-a940e7b1d1b6b832e2ec732a11f495240156fb31.tar.gz
Do not allow eavedropping unless rule owner explicitely declare it
Adds "eavesdrop=true" as a match rule, meaning that the owner intend to eavedrop. Otherwise the owner will receive only broadcasted messages and the ones meant to be delivered to it. [plus a typo fix in an error message -smcv] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37890 Bug-NB: NB#269748 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Diffstat (limited to 'bus/signals.h')
-rw-r--r--bus/signals.h25
1 files changed, 17 insertions, 8 deletions
diff --git a/bus/signals.h b/bus/signals.h
index 5b086f04..a71d2e45 100644
--- a/bus/signals.h
+++ b/bus/signals.h
@@ -31,14 +31,15 @@
typedef enum
{
- BUS_MATCH_MESSAGE_TYPE = 1 << 0,
- BUS_MATCH_INTERFACE = 1 << 1,
- BUS_MATCH_MEMBER = 1 << 2,
- BUS_MATCH_SENDER = 1 << 3,
- BUS_MATCH_DESTINATION = 1 << 4,
- BUS_MATCH_PATH = 1 << 5,
- BUS_MATCH_ARGS = 1 << 6,
- BUS_MATCH_PATH_NAMESPACE = 1 << 7
+ BUS_MATCH_MESSAGE_TYPE = 1 << 0,
+ BUS_MATCH_INTERFACE = 1 << 1,
+ BUS_MATCH_MEMBER = 1 << 2,
+ BUS_MATCH_SENDER = 1 << 3,
+ BUS_MATCH_DESTINATION = 1 << 4,
+ BUS_MATCH_PATH = 1 << 5,
+ BUS_MATCH_ARGS = 1 << 6,
+ BUS_MATCH_PATH_NAMESPACE = 1 << 7,
+ BUS_MATCH_CLIENT_IS_EAVESDROPPING = 1 << 8
} BusMatchFlags;
BusMatchRule* bus_match_rule_new (DBusConnection *matches_go_to);
@@ -64,6 +65,14 @@ dbus_bool_t bus_match_rule_set_arg (BusMatchRule *rule,
dbus_bool_t is_path,
dbus_bool_t is_namespace);
+/* Calling this methods a client declares that it is creating a rule which
+ * needs to eavesdrop (e.g., dbus-monitor), any other created rules not
+ * setting themselves as eavesdropping won't receive any message not addressed
+ * to them, when eavedrop is enabled in the policy. On the other hand, when
+ * eavedrop is not enabled in policy, this method won't have any effect */
+void bus_match_rule_set_client_is_eavesdropping (BusMatchRule *rule,
+ dbus_bool_t is_eavesdropping);
+
BusMatchRule* bus_match_rule_parse (DBusConnection *matches_go_to,
const DBusString *rule_text,
DBusError *error);