summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Griffis <pgriffis@igalia.com>2021-12-20 16:00:26 -0600
committerPatrick Griffis <pgriffis@igalia.com>2021-12-20 16:04:07 -0600
commit41827af29b0e305bdb96af560bfe6bebe182f210 (patch)
treeb436f38b0ada9a7bd245d59e6db6b07e52bd9f7f
parent86659a2bfbd673733fc7372454435673c18d72b9 (diff)
downloadflatpak-wip/pgriffis/no-a11y-filtering.tar.gz
run: Add --no-a11y-filtering argwip/pgriffis/no-a11y-filtering
This allows bypassing all filtering for the a11y bus. This is only intended for testing and not regular use which is why it is only an argument and not a permission.
-rw-r--r--app/flatpak-builtins-run.c4
-rw-r--r--common/flatpak-common-types-private.h1
-rw-r--r--common/flatpak-run.c22
3 files changed, 19 insertions, 8 deletions
diff --git a/app/flatpak-builtins-run.c b/app/flatpak-builtins-run.c
index d30a4a72..9553589d 100644
--- a/app/flatpak-builtins-run.c
+++ b/app/flatpak-builtins-run.c
@@ -45,6 +45,7 @@ static gboolean opt_devel;
static gboolean opt_log_session_bus;
static gboolean opt_log_system_bus;
static gboolean opt_log_a11y_bus;
+static gboolean opt_no_a11y_filtering;
static int opt_a11y_bus = -1;
static int opt_session_bus = -1;
static gboolean opt_no_documents_portal;
@@ -75,6 +76,7 @@ static GOptionEntry options[] = {
{ "log-a11y-bus", 0, 0, G_OPTION_ARG_NONE, &opt_log_a11y_bus, N_("Log accessibility bus calls"), NULL },
{ "no-a11y-bus", 0, G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &opt_a11y_bus, N_("Don't proxy accessibility bus calls"), NULL },
{ "a11y-bus", 0, 0, G_OPTION_ARG_NONE, &opt_a11y_bus, N_("Proxy accessibility bus calls (default except when sandboxed)"), NULL },
+ { "no-a11y-filtering", 0, 0, G_OPTION_FLAG_REVERSE, &opt_no_a11y_filtering, N_("Do not filter calls on the a11y bus"), NULL },
{ "no-session-bus", 0, G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &opt_session_bus, N_("Don't proxy session bus calls"), NULL },
{ "session-bus", 0, 0, G_OPTION_ARG_NONE, &opt_session_bus, N_("Proxy session bus calls (default except when sandboxed)"), NULL },
{ "no-documents-portal", 0, 0, G_OPTION_ARG_NONE, &opt_no_documents_portal, N_("Don't start portals"), NULL },
@@ -302,6 +304,8 @@ flatpak_builtin_run (int argc, char **argv, GCancellable *cancellable, GError **
flags |= FLATPAK_RUN_FLAG_PARENT_SHARE_PIDS;
if (!opt_a11y_bus)
flags |= FLATPAK_RUN_FLAG_NO_A11Y_BUS_PROXY;
+ if (opt_no_a11y_filtering)
+ flags |= FLATPAK_RUN_FLAG_NO_A11Y_FILTERING;
if (!opt_session_bus)
flags |= FLATPAK_RUN_FLAG_NO_SESSION_BUS_PROXY;
diff --git a/common/flatpak-common-types-private.h b/common/flatpak-common-types-private.h
index 05130144..22cb824f 100644
--- a/common/flatpak-common-types-private.h
+++ b/common/flatpak-common-types-private.h
@@ -49,6 +49,7 @@ typedef enum {
FLATPAK_RUN_FLAG_NO_PROC = (1 << 19),
FLATPAK_RUN_FLAG_PARENT_EXPOSE_PIDS = (1 << 20),
FLATPAK_RUN_FLAG_PARENT_SHARE_PIDS = (1 << 21),
+ FLATPAK_RUN_FLAG_NO_A11Y_FILTERING = (1 << 22),
} FlatpakRunFlags;
typedef struct FlatpakDir FlatpakDir;
diff --git a/common/flatpak-run.c b/common/flatpak-run.c
index 5570efb3..f62a40ee 100644
--- a/common/flatpak-run.c
+++ b/common/flatpak-run.c
@@ -1010,16 +1010,22 @@ flatpak_run_add_a11y_dbus_args (FlatpakBwrap *app_bwrap,
flatpak_bwrap_add_args (proxy_arg_bwrap,
a11y_address,
- proxy_socket, "--filter", "--sloppy-names",
- "--call=org.a11y.atspi.Registry=org.a11y.atspi.Socket.Embed@/org/a11y/atspi/accessible/root",
- "--call=org.a11y.atspi.Registry=org.a11y.atspi.Socket.Unembed@/org/a11y/atspi/accessible/root",
- "--call=org.a11y.atspi.Registry=org.a11y.atspi.Registry.GetRegisteredEvents@/org/a11y/atspi/registry",
- "--call=org.a11y.atspi.Registry=org.a11y.atspi.DeviceEventController.GetKeystrokeListeners@/org/a11y/atspi/registry/deviceeventcontroller",
- "--call=org.a11y.atspi.Registry=org.a11y.atspi.DeviceEventController.GetDeviceEventListeners@/org/a11y/atspi/registry/deviceeventcontroller",
- "--call=org.a11y.atspi.Registry=org.a11y.atspi.DeviceEventController.NotifyListenersSync@/org/a11y/atspi/registry/deviceeventcontroller",
- "--call=org.a11y.atspi.Registry=org.a11y.atspi.DeviceEventController.NotifyListenersAsync@/org/a11y/atspi/registry/deviceeventcontroller",
+ proxy_socket,
NULL);
+ if ((flags & FLATPAK_RUN_FLAG_NO_A11Y_FILTERING) != 0)
+ g_debug ("Allowing unfiltered a11y bus");
+ else
+ flatpak_bwrap_add_args ("--filter", "--sloppy-names",
+ "--call=org.a11y.atspi.Registry=org.a11y.atspi.Socket.Embed@/org/a11y/atspi/accessible/root",
+ "--call=org.a11y.atspi.Registry=org.a11y.atspi.Socket.Unembed@/org/a11y/atspi/accessible/root",
+ "--call=org.a11y.atspi.Registry=org.a11y.atspi.Registry.GetRegisteredEvents@/org/a11y/atspi/registry",
+ "--call=org.a11y.atspi.Registry=org.a11y.atspi.DeviceEventController.GetKeystrokeListeners@/org/a11y/atspi/registry/deviceeventcontroller",
+ "--call=org.a11y.atspi.Registry=org.a11y.atspi.DeviceEventController.GetDeviceEventListeners@/org/a11y/atspi/registry/deviceeventcontroller",
+ "--call=org.a11y.atspi.Registry=org.a11y.atspi.DeviceEventController.NotifyListenersSync@/org/a11y/atspi/registry/deviceeventcontroller",
+ "--call=org.a11y.atspi.Registry=org.a11y.atspi.DeviceEventController.NotifyListenersAsync@/org/a11y/atspi/registry/deviceeventcontroller",
+ NULL);
+
if ((flags & FLATPAK_RUN_FLAG_LOG_A11Y_BUS) != 0)
flatpak_bwrap_add_args (proxy_arg_bwrap, "--log", NULL);