summaryrefslogtreecommitdiff
path: root/atk-adaptor/bridge.c
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@gnome.org>2022-06-09 21:05:10 -0500
committerFederico Mena Quintero <federico@gnome.org>2022-06-09 21:35:17 -0500
commitab4b22ccd6303fa52a7afc672ad88eda7a05d233 (patch)
tree06cf54649c7b15b4978e418c105d3614ff458287 /atk-adaptor/bridge.c
parentf04ce7f1787218186b06f4e39577f472739948fd (diff)
downloadat-spi2-core-ab4b22ccd6303fa52a7afc672ad88eda7a05d233.tar.gz
spi_atk_create_socket(): escape just the socket path, not the full unix: address
My bad, sorry :(
Diffstat (limited to 'atk-adaptor/bridge.c')
-rw-r--r--atk-adaptor/bridge.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/atk-adaptor/bridge.c b/atk-adaptor/bridge.c
index c114c9dc..d0cd773a 100644
--- a/atk-adaptor/bridge.c
+++ b/atk-adaptor/bridge.c
@@ -931,6 +931,8 @@ spi_atk_create_socket (SpiBridge *app)
DBusServer *server;
DBusError error;
const gchar *user_runtime_dir = g_get_user_runtime_dir ();
+ char *socket_path;
+ char *escaped_socket_path;
if (g_mkdir_with_parents (user_runtime_dir, 0700) != 0)
return -1;
@@ -948,13 +950,20 @@ spi_atk_create_socket (SpiBridge *app)
}
if (app->app_tmp_dir)
- app->app_bus_addr = g_strdup_printf ("unix:path=%s/socket", app->app_tmp_dir);
+ {
+ socket_path = g_strdup_printf ("%s/socket", app->app_tmp_dir);
+ }
else
- app->app_bus_addr = g_strdup_printf ("unix:path=%s/at-spi2-socket-%d",
- user_runtime_dir, getpid ());
+ {
+ socket_path = g_strdup_printf ("%s/at-spi2-socket-%d",
+ user_runtime_dir, getpid ());
+ }
- if (!app->app_bus_addr)
- return -1;
+ escaped_socket_path = dbus_address_escape_value (socket_path);
+ g_free (socket_path);
+
+ app->app_bus_addr = g_strconcat ("unix:path=", escaped_socket_path, NULL);
+ dbus_free (escaped_socket_path);
dbus_error_init(&error);
server = dbus_server_listen(app->app_bus_addr, &error);