summaryrefslogtreecommitdiff
path: root/bus
Commit message (Collapse)AuthorAgeFilesLines
* Fix the build when dbus-broker is not foundMike Gorse2023-05-111-2/+2
|
* More build fixesMike Gorse2023-05-111-11/+32
| | | | | | | | | | | | | My last commit broke the build where dbus-daemon was set to be used by default. Added a use_systemd option that can be set to false to disable systemd. This cannot be used in combination with dbus-broker and results in dbus-broker support being disabled. If this option is left set to true, then dbus-broker support will be enabled if dbus-broker-launch is found on the system, although dbus-daemon will still be used when available unless default_bus is set to dbus-broker. Fixes #116
* Scan for dbus-daemon even if dbus-broker should be used by defaultMike Gorse2023-05-111-24/+29
| | | | | | | !134 broke the fallback to use dbus-daemon when dbus-broker was configured at build time but is not installed on the system. Fixes #115
* meson: Avoid requiring libsystemd when configured to use dbus-daemonAdrian Perez de Castro2023-04-241-27/+26
| | | | | | | | | | Checks for dbus-daemon and dbus-broker only when they are chosen with default_bus. This avoids requiring the systemd libraries if one wants the built at-spi2-core to use dbus-daemon, but dbus-worker is somehow available in the $PATH. A typical scenario is cross compilation, where the build host may have a dbus-broker program available, but the target system may not have it (or may not have nor want to use the systemd libraries).
* at-spi-dbus-bus service: set stop timeout to 5sSamuel Thibault2023-01-251-0/+1
| | | | | | | | | | | | As reported on https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=890833 sometimes the at-spi bus may hang, and system shutdown then gets stuck. We'd better avoid hanging the whole system shutdown just for this, and just wait for 5s, like many other gnome user service pieces. Of course, at-spi2-core shouldn't be getting stuck, but better avoid hurting people, which makes them tend to just disable accessibility...
* Reformat all the *.[ch] files with clang-formatFederico Mena Quintero2022-12-061-160/+155
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I ran this on each directory with C files: clang-format -i *.[ch] "-i" is the in-place option. I also adjusted the order of #includes for some files which failed to build after that: Clang-format reorders blocks of #include directives alphabetically, but they can be grouped and separated by blank lines. If there is a blank line between blocks, like #include "zork.h" #include "bar.h" #include "foo.h" then it will not put zork.h after the other two. The last two header files will be sorted alphabetically. We can adjust the formatting of chunks of code by hand with comments like these: /* clang-format off */ this code { is, formatted, by, hand; } /* clang-format on */ See https://clang.llvm.org/docs/ClangFormat.html for the general manual and https://clang.llvm.org/docs/ClangFormatStyleOptions.html for the style options and the comments described above.
* Merge branch 'slice' into 'main'Mike Gorse2022-07-251-0/+1
|\ | | | | | | | | Mark bus service as belonging to the session slice See merge request GNOME/at-spi2-core!102
| * Mark bus service as belonging to the session sliceDavid Edmundson2022-07-201-0/+1
| |
* | Bind AT SPI Bus to graphical sessionDavid Edmundson2022-07-201-0/+1
|/ | | | This will exit at logout from the active graphical session.
* meson: use full_path() instead of path() for Meson 0.55 onwardsFederico Mena Quintero2022-05-231-2/+2
|
* Merge branch 'sun' into 'master'Mike Gorse2022-03-241-1/+1
|\ | | | | | | | | ensure_a11y_bus_broker: Fix initializing char array See merge request GNOME/at-spi2-core!74
| * ensure_a11y_bus_broker: Fix initializing char arraySamuel Thibault2022-03-131-1/+1
| |
* | bus launcher: unlink socket before bindingMike Gorse2022-03-111-1/+4
|/ | | | | | | Ensure_a11y_bus_broker should ensure that the socket doesn't already exist before trying to bind to it. Otherwise, binding will fail. Helps: #43
* Bus launcher: ensure that at-spi directory can be created before usingMike Gorse2022-02-161-9/+13
| | | | Related to https://gitlab.gnome.org/GNOME/at-spi2-core/issues/43
* at-spi-bus-launcher: add a couple of sanity checksMike Gorse2022-02-141-0/+7
| | | | | | | 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
* Really escape the bus address before passing to dbus-daemonMike Gorse2022-01-041-1/+1
| | | | | | The last commit didn't actually used the escaped value. Oops! https://gitlab.gnome.org/GNOME/at-spi2-coire/issues/48
* Bus launcher: escape socket name before passing to dbus-daemonMike Gorse2022-01-041-0/+2
| | | | Fixes #48
* at-spi-bus-launcher: allocate _global_app with g_new0, not g_slice_new0Federico Mena Quintero2021-12-141-1/+1
| | | | | The latter is more or less deprecated now that the system malloc is actually good.
* Remove set_bus_to_exit_if_this_process_dies()Federico Mena Quintero2021-12-131-11/+0
| | | | | This was only used for dbus-broker. Same as for dbus-daemon, I don't think we need to set the daemon to die anymore.
* Fix double-free of at_spi_dirFederico Mena Quintero2021-12-131-1/+0
|
* Remove unused function setup_bus_child_daemon()Federico Mena Quintero2021-12-131-8/+0
| | | | | | | | | | The switch to G_SPAWN_LEAVE_DESCRIPTORS_OPEN makes g_spawn_async_with_pipes_and_fds() use the code path for posix_spawn(), which doesn't use a child setup func. I think setting the bus to exit when at-spi-bus-launcher exits is a leftover from when the latter was rewritten in 2011, and we didn't have reliable ways of ending session daemons.
* Try the posix_spawn() code path from g_spawn_async_with_pipes_and_fds()Federico Mena Quintero2021-12-131-2/+2
|
* Future-proof the count of source_fds / target_fdsPhilip Withnall2021-12-131-1/+2
| | | Thanks to Philip Withnall for the suggestions.
* Don't close the read end of the pipe in the child setup funcFederico Mena Quintero2021-12-131-5/+0
| | | | g_spawn_async_with_pipes_and_fds() will take care of that.
* Use g_spawn_async_with_pipes_and_fds() to pass down a specific FDFederico Mena Quintero2021-12-131-8/+19
| | | | | Otherwise, g_spawn_async() closes everything except stdin/stdout/stderr. How very neat of it :)
* Don't pass a hardcoded file descriptor to --print-addressFederico Mena Quintero2021-12-131-4/+8
| | | | | Instead just use whatever the write end of pipe() is. I don't like the idea of dup2() unconditionally closing fd=3.
* Use a helper variable for the --address command line argumentFederico Mena Quintero2021-12-131-6/+14
| | | | It's awkward to fiddle with argv[HARDCODED_NUMBER] later.
* unix_read_all_fd_to_string() - Rewrite with proper error handlingFederico Mena Quintero2021-12-131-11/+38
|
* Call g_spawn_close_pid() when we don't need it anymoreFederico Mena Quintero2021-12-131-1/+6
| | | | | This does nothing on Unix, but the GIO documentation recommends it as necessary on Windows.
* Use GPid instead of int for the a11y_bus_pidFederico Mena Quintero2021-12-131-1/+1
| | | | | We'll start calling g_spawn_async_with_pipes() "properly", so better clean up the types.
* Extract function to prctl() the accessibility busFederico Mena Quintero2021-12-131-7/+12
| | | | Hopefully this makes it easier to port that to BSD, for example.
* bus: Abort if we cannot get the default GSettingsSchemaSourceFederico Mena Quintero2021-12-131-0/+5
| | | | | | | | | | This indicates an incorrect installation. If we proceed, there are critical warnings like (process:985): GLib-GIO-CRITICAL **: 20:10:12.875: g_settings_schema_source_lookup: assertion 'source != NULL' failed and nothing works past that.
* Bus launcher: place a11y bus socket in the user's working directoryMike Gorse2021-12-081-5/+40
| | | | | | | | | | The old behavior of using /tmp broke accessibility for Snap-confined applications, since Snap provides a private version of /tmp. Also stop using abstract sockets for dbus-broker, except that we fall back to the old behavior in the unlikely event that the user's working directory can't be determined. Fixes #43
* Indent XML a bit more nicelyFederico Mena Quintero2021-11-221-4/+4
|
* Actually describe what at-spi-bus-launcher does in bus/README.mdFederico Mena Quintero2021-11-221-6/+94
|
* Move bus/README to README.md to reformat it as MarkdownFederico Mena Quintero2021-11-221-0/+0
|
* Use abstract sockets if libdbus is older than 1.12.0Mike Gorse2021-07-062-1/+7
| | | | Fixes #37
* bus: Set X root property when Xwayland starts on-demandBenjamin Berg2021-05-192-0/+18
| | | | | | | | | | | | | | | | | | | | | On wayland, the X11 server may not always be running so that at-spi-bus-launcher cannot set it when it is starting. This is usually not a big problem, as applications can retrieve the a11y bus address by querying the session bus. Unfortunately, there may be exceptions such as applications that are run as a different user. We can easily solve this problem by setting the X11 root property when the Xwayland server is started. To do so, install a simple script to /etc/xdg/Xwayland-session.d/ that queries the session bus and sets the root property. This script is only needed when Xwayland is started on-demand, which can only happen on systemd enabled sessions. However, it is always safe to install, and there will be no severe side effects should the script be running needlessly or failing. Closes: #34
* Use unix sockets instead of abstract socketsTianon Gravi2020-12-251-1/+1
| | | | | | | | | | | | | | | | Quoting Michael Catanzaro: > Secure host services must not use abstract sockets. > > - If your sandboxed application uses --share=net to access the host > network namespace, which is required for internet access, then it > gets access to all the host's abstract sockets as well. Loads of > sandboxed applications necessarily have to use --share=net. > > - If your sandboxed application does not use --share=net, it cannot > access any host abstract sockets. This also requires bumping the minimum glib version to 2.62.
* Don't use dbus-broker if not running under systemdMichael Catanzaro2020-09-242-1/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since gdm@febeb9a9, gdm no longer runs a systemd user session, because gdm supports multiseat but systemd only allows one graphical session per user. Since gdm currently runs as the gdm user, that means we cannot use systemd there. Benjamin Berg says we could fix that by changing gdm to use temporary users for each seat, but that would be a lot of work. Meanwhile, dbus-broker relies on systemd to autostart D-Bus services. So if we are not running a systemd user session, nothing gets autostarted in response to D-Bus calls. That means orca never gets any response to its method calls to org.a11y.atspi.Registry, and we wind up with no accessibility on the gnome-shell login screen. Fix this by implementing Benjamin's suggested check to see if we are running under systemd before using dbus-broker. So now we will use dbus-daemon on the login screen, but we will still use dbus-broker for the user session (except in distros that still prefer dbus-daemon... which is actually the default configuration). libsystemd is added as a build dependency whenever built with dbus-broker support, which should be uncontroversial because it won't work without systemd. I expect dbus-daemon is going to live alongside dbus-broker for a long time, because it seems very hard for us to migrate fully. Big thanks to Benjamin Berg for discovering the problem and suggesting this solution. Fixes #25
* Make at-spi-dbus-bus.desktop Validateworldofpeace2020-06-171-1/+1
| | | | | | Else desktop-file-validate fails with: ``` error: value "GSETTINGS org.gnome.desktop.interface toolkit-accessibility" for key "AutostartCondition" in group "Desktop Entry" contains an unregistered value "GSETTINGS" for the condition; values extending the format should start with "X-" ```
* bus-launcher: Use async callback for RegisterClientMike Gorse2020-02-271-32/+46
| | | | | | | | | | | | | | This should make the process more robust, in combination with setting the timeout to G_MAXINT, rather than -1, which effectively defaults to 25 seconds. Otherwise, it is possible for the session manager to be unresponsive, perhaps waiting for a synchronous call of its own to time out, and then the session manager will eventually process the RegisterClient, but at-spi-bus-launcher will have timed out, meaning that we successfully register with the session manager but don't ever set up our signal handler, meaning that, later, the session manager sends a QueryEndSession to us, but we don't see it. https://bugzilla.opensuse.org/show_bug.cgi?id=1154582
* meson: Remove useless "install: true"Samuel Thibault2019-11-261-4/+0
| | | | True is already the default.
* at-spi-bus-launcher: defer starting atspi bus after bus name acquiredSamuel Thibault2019-09-061-10/+12
| | | | | | | In case bus name acquisition fails, we should not have started a bus after all, but worse, we should not have written its address in the AT_SPI_BUS X root property. We should thus do them only after having acquired the bus name.
* at-spi-bus-launcher: Only clear AT_SPI_BUS X prop when having set itSamuel Thibault2019-09-061-1/+5
| | | | | In case where bus name acquisition fails, we shall not drop the AT_SPI_BUS X property of the existing daemon.
* at-spi-bus-launcher: clear a11y_bus_pid when failing to read addressSamuel Thibault2019-09-061-0/+1
| | | | | | This may happen if dbus-daemon spawns but fails to start. In that case after terminating it we should forget its pid, to avoid trying to terminate it again at the end of main().
* Relicense as LGPL 2.1Mike Gorse2019-08-281-4/+4
| | | | Fixes https://gitlab.gnome.org/GNOME/at-spi2-core/issues/2
* Fix outdated FSF addressMike Gorse2019-08-271-2/+2
|
* Add /usr/lib/dbus-daemon to list of paths to check inAlan Coopersmith2019-06-161-0/+1
| | | | | | This is where Solaris installs it. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Resort to WAYLAND_DISPLAY checks to avoid X11 connectionsCarlos Garnacho2019-05-211-2/+2
| | | | | | | | | | | | Same reasoning applies (Opening and closing X11 displays may be from ineffective to harmful there), but the XDG_SESSION_TYPE check breaks for startx. Explicitly check that DISPLAY is present but WAYLAND_DISPLAY is not, in order to avoid this behavior. Pointed out at https://gitlab.gnome.org/GNOME/at-spi2-core/merge_requests/12