@@ -0,0 +1,84 @@
1+From 55d499f4cd5667c04c21f7201d7f10484e187907 Mon Sep 17 00:00:00 2001
2+From: Florian Klink <flokli@flokli.de>
3+Date: Sun, 27 Dec 2020 13:03:12 +0100
4+Subject: [PATCH] unit/test-dbus: pick up dbus-daemon from $PATH
5+
6+This allows running the unit tests in environments where `dbus-daemon`
7+isn't in /usr/bin, but in $PATH.
8+
9+Signed-off-by: Florian Klink <flokli@flokli.de>
10+---
11+ unit/test-dbus-message-fds.c | 4 ++--
12+ unit/test-dbus-properties.c | 4 ++--
13+ unit/test-dbus.c | 4 ++--
14+ 3 files changed, 6 insertions(+), 6 deletions(-)
15+
16+diff --git a/unit/test-dbus-message-fds.c b/unit/test-dbus-message-fds.c
17+index 6f68bae..4b5662e 100644
18+--- a/unit/test-dbus-message-fds.c
19++++ b/unit/test-dbus-message-fds.c
20+@@ -51,7 +51,7 @@ static bool start_dbus_daemon(void)
21+ char *prg_envp[1];
22+ pid_t pid;
23+
24+- prg_argv[0] = "/usr/bin/dbus-daemon";
25++ prg_argv[0] = "dbus-daemon";
26+ prg_argv[1] = "--nopidfile";
27+ prg_argv[2] = "--nofork";
28+ prg_argv[3] = "--config-file=" UNITDIR "dbus.conf";
29+@@ -68,7 +68,7 @@ static bool start_dbus_daemon(void)
30+ }
31+
32+ if (pid == 0) {
33+- execve(prg_argv[0], prg_argv, prg_envp);
34++ execvpe(prg_argv[0], prg_argv, prg_envp);
35+ exit(EXIT_SUCCESS);
36+ }
37+
38+diff --git a/unit/test-dbus-properties.c b/unit/test-dbus-properties.c
39+index b435062..049f0f4 100644
40+--- a/unit/test-dbus-properties.c
41++++ b/unit/test-dbus-properties.c
42+@@ -49,7 +49,7 @@ static bool start_dbus_daemon(void)
43+ char *prg_envp[1];
44+ pid_t pid;
45+
46+- prg_argv[0] = "/usr/bin/dbus-daemon";
47++ prg_argv[0] = "dbus-daemon";
48+ prg_argv[1] = "--nopidfile";
49+ prg_argv[2] = "--nofork";
50+ prg_argv[3] = "--config-file=" UNITDIR "dbus.conf";
51+@@ -66,7 +66,7 @@ static bool start_dbus_daemon(void)
52+ }
53+
54+ if (pid == 0) {
55+- execve(prg_argv[0], prg_argv, prg_envp);
56++ execvpe(prg_argv[0], prg_argv, prg_envp);
57+ exit(EXIT_SUCCESS);
58+ }
59+
60+diff --git a/unit/test-dbus.c b/unit/test-dbus.c
61+index 67f0a7b..582847e 100644
62+--- a/unit/test-dbus.c
63++++ b/unit/test-dbus.c
64+@@ -45,7 +45,7 @@ static void start_dbus_daemon(void)
65+ char *prg_envp[1];
66+ pid_t pid;
67+
68+- prg_argv[0] = "/usr/bin/dbus-daemon";
69++ prg_argv[0] = "dbus-daemon";
70+ prg_argv[1] = "--nopidfile";
71+ prg_argv[2] = "--nofork";
72+ prg_argv[3] = "--config-file=" UNITDIR "dbus.conf";
73+@@ -62,7 +62,7 @@ static void start_dbus_daemon(void)
74+ }
75+
76+ if (pid == 0) {
77+- execve(prg_argv[0], prg_argv, prg_envp);
78++ execvpe(prg_argv[0], prg_argv, prg_envp);
79+ exit(EXIT_SUCCESS);
80+ }
81+
82+--
83+2.29.2
84+