summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2016-04-14 10:01:42 -0400
committerMatthias Clasen <mclasen@redhat.com>2016-04-14 10:01:42 -0400
commit4283473b38b4b8a7ea5975af5a85cb6f5b518fb1 (patch)
tree6bcda48b9d8d84acbf334582854df033d5b6b7fc /app
parentdb797bf4dfd4bd55b28220826cc652c5ee75093d (diff)
downloadxdg-app-4283473b38b4b8a7ea5975af5a85cb6f5b518fb1.tar.gz
Add options to enable bus logging
This can be useful to find out what bus names your app is actually talking to, so you can set up a bus policy that is narrowed than blanket access without breaking your application.
Diffstat (limited to 'app')
-rw-r--r--app/xdg-app-builtins-run.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/xdg-app-builtins-run.c b/app/xdg-app-builtins-run.c
index b9c0422..0d3f8c5 100644
--- a/app/xdg-app-builtins-run.c
+++ b/app/xdg-app-builtins-run.c
@@ -39,6 +39,8 @@ static char *opt_arch;
static char *opt_branch;
static char *opt_command;
static gboolean opt_devel;
+static gboolean opt_log_session_bus;
+static gboolean opt_log_system_bus;
static char *opt_runtime;
static char *opt_runtime_version;
@@ -49,6 +51,8 @@ static GOptionEntry options[] = {
{ "devel", 'd', 0, G_OPTION_ARG_NONE, &opt_devel, "Use development runtime", NULL },
{ "runtime", 0, 0, G_OPTION_ARG_STRING, &opt_runtime, "Runtime to use", "RUNTIME" },
{ "runtime-version", 0, 0, G_OPTION_ARG_STRING, &opt_runtime_version, "Runtime version to use", "VERSION" },
+ { "log-session-bus", 0, 0, G_OPTION_ARG_NONE, &opt_log_session_bus, "Log session bus calls", NULL },
+ { "log-system-bus", 0, 0, G_OPTION_ARG_NONE, &opt_log_system_bus, "Log system bus calls", NULL },
{ NULL }
};
@@ -105,7 +109,9 @@ xdg_app_builtin_run (int argc, char **argv, GCancellable *cancellable, GError **
arg_context,
opt_runtime,
opt_runtime_version,
- opt_devel ? XDG_APP_RUN_FLAG_DEVEL : 0,
+ (opt_devel ? XDG_APP_RUN_FLAG_DEVEL : 0) |
+ (opt_log_session_bus ? XDG_APP_RUN_FLAG_LOG_SESSION_BUS : 0) |
+ (opt_log_system_bus ? XDG_APP_RUN_FLAG_LOG_SYSTEM_BUS : 0),
opt_command,
&argv[rest_argv_start + 1],
rest_argc - 1,