}
}
-static int process_hello(sd_bus *a, sd_bus *b, sd_bus_message *m, bool *got_hello) {
+static int process_hello(sd_bus *a, sd_bus *b, sd_bus_message *m, Policy *policy, const struct ucred *ucred, bool *got_hello) {
_cleanup_bus_message_unref_ sd_bus_message *n = NULL;
bool is_hello;
int r;
return -EIO;
}
+ if (!policy_check_hello(policy, ucred)) {
+ log_error("Policy denied HELLO");
+ return -EPERM;
+ }
+
*got_hello = true;
if (!a->is_kernel)
goto finish;
}
- k = process_hello(a, b, m, &got_hello);
+ k = process_hello(a, b, m, &policy, &ucred, &got_hello);
if (k < 0) {
r = k;
log_error("Failed to process HELLO: %s", strerror(-r));