Find more progs on PATH instead of hardcoding them.
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)
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;
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);
}
#include <poll.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 "pidref.h"
#include "polkit-agent.h"
#include "stdio-util.h"
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;
&pipe_fd[1],
1,
&agent_pidref,
- POLKIT_AGENT_BINARY_PATH,
+ pkttyagent,
"--notify-fd", notify_fd,
"--fallback");
if (r < 0)
[Service]
Type=oneshot
RemainAfterExit=yes
-ExecStart=/sbin/ldconfig -X
+ExecStart=ldconfig -X
[Service]
Type=oneshot
-ExecStart=-/sbin/modprobe -abq %i
+ExecStart=-modprobe -abq %i