Commit b602ab70 authored by Rasmus Thomsen's avatar Rasmus Thomsen Committed by Ariadne Conill

main/dbus: fix deadlock

This avoids calling opendir() which mallocs, and as such isn't async-signal
safe, which can lead to deadlocks if called between fork() and exec()
parent 9f0c2c14
# Maintainer: Natanael Copa <>
pkgdesc=" message bus system"
options="!check" # Introduces circular dependency with xorg-server (xvfb-run -> xvfb)
......@@ -23,6 +23,7 @@ checkdepends="xvfb-run"
install="$pkgname.pre-install $"
......@@ -88,4 +89,5 @@ x11() {
sha512sums="0964683bc6859374cc94e42e1ec0cdb542cca67971c205fcba4352500b6c0891665b0718e7d85eb060c81cb82e3346c313892bc02384da300ddd306c7eef0056 dbus-1.12.20.tar.gz
3db35499361e84d8e2469b88b033f49813b179188ac25f1841a989988c352af398a56dfd94383813626c6dfd032194f7a9fcdba001ccc3e005e7cd22dae7a7ed 0001-_dbus_generate_random_bytes-use-getrandom-2.patch
cdd01f51882be4f388515441237aa6318888db6e88a4d980bafbf9b790945e4d959c6633d6d002274c0a617ac919f9355ba628c9b502b355f73fed602f997791 avoid-opendir-between-fork-exec.patch
4c6beba2382416e60a3adfa85ef843d90d93ca5f38c23f573e058ffca6d4fc3850d11d40938c74383bba61599569b7fdfb1fcf3b9d2f1463e6b2e2cc81097c84 dbus.initd"
Author: Rasmus Thomsen <>
Upstream: No
Reason: The code inside the `#ifdef __linux__` calls opendir. This can
lead to deadlocks when act_on_fds_3_and_up is called between fork&exec since
opendir mallocs which isn't async signal safe
diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c
index 0288dbc9..e585136f 100644
--- a/dbus/dbus-sysdeps-unix.c
+++ b/dbus/dbus-sysdeps-unix.c
@@ -4742,7 +4742,7 @@ act_on_fds_3_and_up (void (*func) (int fd))
int maxfds, i;
-#ifdef __linux__
+#if defined(__linux__) && defined(__GLIBC__)
DIR *d;
/* On Linux we can optimize this a bit if /proc is available. If it
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment