summaryrefslogtreecommitdiff
path: root/bus
diff options
context:
space:
mode:
authorMike Gorse <mgorse@suse.com>2022-02-14 15:44:31 -0600
committerMike Gorse <mgorse@suse.com>2022-02-14 15:46:50 -0600
commit182318e21ca0079f0ba485118fadde015d928bf3 (patch)
tree6a5cd0b618b73fdf8012ce4291f15929e26e402f /bus
parentff985baed11cfb157358ea44db1e648bbaafeceb (diff)
downloadat-spi2-core-182318e21ca0079f0ba485118fadde015d928bf3.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
Diffstat (limited to 'bus')
-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 d86e7d36..c33ef64c 100644
--- a/bus/at-spi-bus-launcher.c
+++ b/bus/at-spi-bus-launcher.c
@@ -541,6 +541,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);