Skip to content

Commit 5b193a8

Browse files
niksturkeszybz
authored andcommitted
meson: read more progs from PATH
Find more progs on PATH instead of hardcoding them.
1 parent 5e0c1f2 commit 5b193a8

6 files changed

Lines changed: 16 additions & 7 deletions

File tree

meson.build

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ conf.set_quoted('KERNEL_INSTALL_DIR', kernelinstalldir)
256256
conf.set_quoted('MODPROBE_DIR', modprobedir)
257257
conf.set_quoted('MODULESLOAD_DIR', modulesloaddir)
258258
conf.set_quoted('PKGSYSCONFDIR', pkgsysconfdir)
259-
conf.set_quoted('POLKIT_AGENT_BINARY_PATH', bindir / 'pkttyagent')
260259
conf.set_quoted('POLKIT_RULES_DIR', polkitrulesdir)
261260
conf.set_quoted('PREFIX', prefixdir)
262261
conf.set_quoted('PREFIX_NOSLASH', prefixdir_noslash)

src/journal/cat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ static int run(int argc, char *argv[]) {
158158
return log_error_errno(r, "Failed to rearrange stdout/stderr: %m");
159159

160160
if (argc <= optind)
161-
(void) execl("/bin/cat", "/bin/cat", NULL);
161+
(void) execlp("cat", "cat", NULL);
162162
else {
163163
struct stat st;
164164

src/nspawn/nspawn-setuid.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ static int spawn_getent(const char *database, const char *key, PidRef *ret) {
3838
return r;
3939
}
4040
if (r == 0) {
41-
execle("/usr/bin/getent", "getent", database, key, NULL, &(char*[1]){});
42-
execle("/bin/getent", "getent", database, key, NULL, &(char*[1]){});
41+
execlp("getent", "getent", database, key, NULL);
4342
_exit(EXIT_FAILURE);
4443
}
4544

src/shared/polkit-agent.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
#include <poll.h>
44
#include <unistd.h>
55

6+
#include "alloc-util.h"
67
#include "bus-util.h"
78
#include "exec-util.h"
89
#include "fd-util.h"
910
#include "io-util.h"
1011
#include "log.h"
12+
#include "path-util.h"
1113
#include "pidref.h"
1214
#include "polkit-agent.h"
1315
#include "stdio-util.h"
@@ -31,6 +33,15 @@ int polkit_agent_open(void) {
3133
if (r <= 0)
3234
return r;
3335

36+
_cleanup_free_ char *pkttyagent = NULL;
37+
r = find_executable("pkttyagent", &pkttyagent);
38+
if (r == -ENOENT) {
39+
log_debug("pkttyagent binary not available, ignoring.");
40+
return 0;
41+
}
42+
if (r < 0)
43+
return log_error_errno(r, "Failed to determine whether pkttyagent binary exists: %m");
44+
3445
if (pipe2(pipe_fd, 0) < 0)
3546
return -errno;
3647

@@ -40,7 +51,7 @@ int polkit_agent_open(void) {
4051
&pipe_fd[1],
4152
1,
4253
&agent_pidref,
43-
POLKIT_AGENT_BINARY_PATH,
54+
pkttyagent,
4455
"--notify-fd", notify_fd,
4556
"--fallback");
4657
if (r < 0)

units/ldconfig.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ Before=shutdown.target initrd-switch-root.target
2525
[Service]
2626
Type=oneshot
2727
RemainAfterExit=yes
28-
ExecStart=/sbin/ldconfig -X
28+
ExecStart=ldconfig -X

units/modprobe@.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ StartLimitIntervalSec=0
3232

3333
[Service]
3434
Type=oneshot
35-
ExecStart=-/sbin/modprobe -abq %i
35+
ExecStart=-modprobe -abq %i

0 commit comments

Comments
 (0)