summaryrefslogtreecommitdiff
path: root/bus/policy.h
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2017-07-19 15:53:17 +0100
committerSimon McVittie <smcv@debian.org>2017-07-28 11:24:20 +0100
commit7424c3499f1cfafabfca49710e757eb43813f65e (patch)
treeb4ddb57785ada4a7ec4e4093c918964fcda9d9bf /bus/policy.h
parent2d3f751716c64c3d7997bbcd362df5e4a6b1d63e (diff)
downloaddbus-7424c3499f1cfafabfca49710e757eb43813f65e.tar.gz
Add send_broadcast as an attribute of <allow> and <deny> elements
<allow send_broadcast="true" ...> only matches broadcasts, which are signals with a NULL destination. There was previously no way for the policy language to express "NULL destination", only "any destination". <allow send_broadcast="false" ...> only matches non-broadcasts, which are non-signals or signals with a non-NULL destination. There was previously no way for the policy language to express "any non-NULL destination", only "any destination". Reviewed-by: Philip Withnall <withnall@endlessm.com> [smcv: improved documentation as per Philip's review] Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Thiago Macieira <thiago@kde.org> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92853
Diffstat (limited to 'bus/policy.h')
-rw-r--r--bus/policy.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/bus/policy.h b/bus/policy.h
index d1d3e72b..c5275a7b 100644
--- a/bus/policy.h
+++ b/bus/policy.h
@@ -39,6 +39,13 @@ typedef enum
BUS_POLICY_RULE_GROUP
} BusPolicyRuleType;
+typedef enum
+{
+ BUS_POLICY_TRISTATE_ANY = 0,
+ BUS_POLICY_TRISTATE_FALSE,
+ BUS_POLICY_TRISTATE_TRUE
+} BusPolicyTristate;
+
/** determines whether the rule affects a connection, or some global item */
#define BUS_POLICY_RULE_IS_PER_CLIENT(rule) (!((rule)->type == BUS_POLICY_RULE_USER || \
(rule)->type == BUS_POLICY_RULE_GROUP))
@@ -66,6 +73,7 @@ struct BusPolicyRule
unsigned int eavesdrop : 1;
unsigned int requested_reply : 1;
unsigned int log : 1;
+ unsigned int broadcast : 2; /**< really a BusPolicyTristate */
} send;
struct