summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gorse <mgorse@suse.com>2022-02-14 15:44:31 -0600
committerMike Gorse <mgorse@suse.com>2022-09-09 10:46:40 -0500
commit6200c3df01b71f0d8f010a4572876e1465519902 (patch)
tree3305d77c4d85050af9722a2986d88b3c34f374f3
parent5ecd06066080c665661e359174afdccfa05f3e5e (diff)
downloadat-spi2-core-6200c3df01b71f0d8f010a4572876e1465519902.tar.gz
at-spi-bus-launcher: add a couple of sanity checks
Ensure that xdg_runtime_dir exists and that it is an absolute path. Hopefully this will fix Ubuntu's tests. Related to https://gitlab.gnome.org/GNOME/at-spi2-core/issues/43
-rw-r--r--bus/at-spi-bus-launcher.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/bus/at-spi-bus-launcher.c b/bus/at-spi-bus-launcher.c
index 0f6286a4..7c6c8035 100644
--- a/bus/at-spi-bus-launcher.c
+++ b/bus/at-spi-bus-launcher.c
@@ -516,6 +516,13 @@ ensure_a11y_bus (A11yBusLauncher *app)
const gchar *display = g_getenv ("DISPLAY");
gchar *at_spi_dir = g_strconcat (xdg_runtime_dir, "/at-spi", NULL);
gchar *p;
+ mkdir (xdg_runtime_dir, 0700);
+ if (!g_path_is_absolute (at_spi_dir))
+ {
+ gchar *new_dir = g_canonicalize_filename (at_spi_dir, NULL);
+ g_free (at_spi_dir);
+ at_spi_dir = new_dir;
+ }
mkdir (at_spi_dir, 0700);
app->socket_name = g_strconcat (at_spi_dir, "/bus", display, NULL);
g_free (at_spi_dir);