[at-spi2-core/gnome-41: 9/14] at-spi-bus-launcher: add a couple of sanity checks




commit 6200c3df01b71f0d8f010a4572876e1465519902
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 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);


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