summaryrefslogtreecommitdiff
path: root/src/bus-proxyd/bus-proxyd.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-06-06 19:41:24 +0200
committerLennart Poettering <lennart@poettering.net>2014-06-06 19:41:24 +0200
commitbcf3295d2b0d87caefad2e73d221aac080d0c11e (patch)
tree0a0af0e976f18a6d56058a02240dc4d0fd58c4ce /src/bus-proxyd/bus-proxyd.c
parent827bf3c5dd88c51080de159e071fcbe7ada3477c (diff)
bus: add basic dbus1 policy parser
Enforcement is still missing, but at least we can parse it now.
Diffstat (limited to 'src/bus-proxyd/bus-proxyd.c')
-rw-r--r--src/bus-proxyd/bus-proxyd.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/bus-proxyd/bus-proxyd.c b/src/bus-proxyd/bus-proxyd.c
index 98b2ffd7d1..9937159fcb 100644
--- a/src/bus-proxyd/bus-proxyd.c
+++ b/src/bus-proxyd/bus-proxyd.c
@@ -45,6 +45,7 @@
#include "strv.h"
#include "def.h"
#include "capability.h"
+#include "bus-policy.h"
static const char *arg_address = DEFAULT_SYSTEM_BUS_PATH;
static char *arg_command_line_buffer = NULL;
@@ -1043,6 +1044,7 @@ int main(int argc, char *argv[]) {
bool is_unix;
struct ucred ucred = {};
_cleanup_free_ char *peersec = NULL;
+ Policy policy = {};
log_set_target(LOG_TARGET_JOURNAL_OR_KMSG);
log_parse_environment();
@@ -1052,6 +1054,14 @@ int main(int argc, char *argv[]) {
if (r <= 0)
goto finish;
+ r = policy_load(&policy);
+ if (r < 0) {
+ log_error("Failed to load policy: %s", strerror(-r));
+ goto finish;
+ }
+
+ /* policy_dump(&policy); */
+
r = sd_listen_fds(0);
if (r == 0) {
in_fd = STDIN_FILENO;
@@ -1414,5 +1424,7 @@ finish:
sd_bus_flush(a);
sd_bus_flush(b);
+ policy_free(&policy);
+
return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
}