summaryrefslogtreecommitdiff
path: root/src/bus-proxyd/bus-policy.h
diff options
context:
space:
mode:
authorDaniel Mack <daniel@zonque.org>2014-09-24 17:02:08 +0200
committerDaniel Mack <daniel@zonque.org>2014-09-24 17:07:14 +0200
commit078ef7b85ad77ba999588f72b31a50ced5907692 (patch)
tree2f2b7220f2c4c5ee6426ebc17b82e245f5617958 /src/bus-proxyd/bus-policy.h
parent04c553e322680b6fcdf5b271e84b0b4b0ad8d5f9 (diff)
bus-policy: split API for bus-proxyd
Instead of operating on an sd_bus_message object, expose an API that has 4 functions: policy_check_own() policy_check_hello() policy_check_recv() policy_check_send() This also allows dropping extra code to parse message contents - the bus proxy already has dedicated code paths for that, and we can hook into those later. Tests amended accordingly.
Diffstat (limited to 'src/bus-proxyd/bus-policy.h')
-rw-r--r--src/bus-proxyd/bus-policy.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/bus-proxyd/bus-policy.h b/src/bus-proxyd/bus-policy.h
index 2222716e7a..5b4d9d0c10 100644
--- a/src/bus-proxyd/bus-policy.h
+++ b/src/bus-proxyd/bus-policy.h
@@ -76,7 +76,22 @@ typedef struct Policy {
int policy_load(Policy *p, char **files);
void policy_free(Policy *p);
-bool policy_check(Policy *p, sd_bus_message *m, const struct ucred *c);
+bool policy_check_own(Policy *p, const struct ucred *ucred, const char *name);
+bool policy_check_hello(Policy *p, const struct ucred *ucred);
+bool policy_check_recv(Policy *p,
+ const struct ucred *ucred,
+ Hashmap *names,
+ int message_type,
+ const char *path,
+ const char *interface,
+ const char *member);
+bool policy_check_send(Policy *p,
+ const struct ucred *ucred,
+ char **names,
+ int message_type,
+ const char *path,
+ const char *interface,
+ const char *member);
void policy_dump(Policy *p);