[at-spi2-core] at-spi-bus-launcher: add a couple of sanity checks



commit 182318e21ca0079f0ba485118fadde015d928bf3
Author: Mike Gorse <mgorse suse com>
Date:   Mon Feb 14 15:44:31 2022 -0600

    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

 bus/at-spi-bus-launcher.c | 7 +++++++
 1 file changed, 7 insertions(+)
---
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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]