mirror of
https://github.com/systemd/systemd.git
synced 2026-08-10 17:14:31 +00:00
meson: read more progs from PATH
Find more progs on PATH instead of hardcoding them. (cherry picked from commit5b193a8e23) (cherry picked from commit78371e5549)
This commit is contained in:
@@ -265,7 +265,6 @@ conf.set_quoted('KERNEL_INSTALL_DIR', kernelinstalldir)
|
||||
conf.set_quoted('MODPROBE_DIR', modprobedir)
|
||||
conf.set_quoted('MODULESLOAD_DIR', modulesloaddir)
|
||||
conf.set_quoted('PKGSYSCONFDIR', pkgsysconfdir)
|
||||
conf.set_quoted('POLKIT_AGENT_BINARY_PATH', bindir / 'pkttyagent')
|
||||
conf.set_quoted('POLKIT_RULES_DIR', polkitrulesdir)
|
||||
conf.set_quoted('PREFIX', prefixdir)
|
||||
conf.set_quoted('PREFIX_NOSLASH', prefixdir_noslash)
|
||||
|
||||
@@ -158,7 +158,7 @@ static int run(int argc, char *argv[]) {
|
||||
return log_error_errno(r, "Failed to rearrange stdout/stderr: %m");
|
||||
|
||||
if (argc <= optind)
|
||||
(void) execl("/bin/cat", "/bin/cat", NULL);
|
||||
(void) execlp("cat", "cat", NULL);
|
||||
else {
|
||||
struct stat st;
|
||||
|
||||
|
||||
@@ -36,8 +36,7 @@ static int spawn_getent(const char *database, const char *key, pid_t *rpid) {
|
||||
return r;
|
||||
}
|
||||
if (r == 0) {
|
||||
execle("/usr/bin/getent", "getent", database, key, NULL, &(char*[1]){});
|
||||
execle("/bin/getent", "getent", database, key, NULL, &(char*[1]){});
|
||||
execlp("getent", "getent", database, key, NULL);
|
||||
_exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,11 +4,13 @@
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "bus-util.h"
|
||||
#include "exec-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "io-util.h"
|
||||
#include "log.h"
|
||||
#include "path-util.h"
|
||||
#include "polkit-agent.h"
|
||||
#include "process-util.h"
|
||||
#include "stdio-util.h"
|
||||
@@ -32,6 +34,15 @@ int polkit_agent_open(void) {
|
||||
if (r <= 0)
|
||||
return r;
|
||||
|
||||
_cleanup_free_ char *pkttyagent = NULL;
|
||||
r = find_executable("pkttyagent", &pkttyagent);
|
||||
if (r == -ENOENT) {
|
||||
log_debug("pkttyagent binary not available, ignoring.");
|
||||
return 0;
|
||||
}
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to determine whether pkttyagent binary exists: %m");
|
||||
|
||||
if (pipe2(pipe_fd, 0) < 0)
|
||||
return -errno;
|
||||
|
||||
@@ -41,7 +52,7 @@ int polkit_agent_open(void) {
|
||||
&pipe_fd[1],
|
||||
1,
|
||||
&agent_pid,
|
||||
POLKIT_AGENT_BINARY_PATH,
|
||||
pkttyagent,
|
||||
"--notify-fd", notify_fd,
|
||||
"--fallback");
|
||||
if (r < 0)
|
||||
|
||||
@@ -25,4 +25,4 @@ Before=shutdown.target initrd-switch-root.target
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
ExecStart=/sbin/ldconfig -X
|
||||
ExecStart=ldconfig -X
|
||||
|
||||
@@ -32,4 +32,4 @@ StartLimitIntervalSec=0
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=-/sbin/modprobe -abq %i
|
||||
ExecStart=-modprobe -abq %i
|
||||
|
||||
Reference in New Issue
Block a user