cdba: Avoid hardcoding ssh binary path

Use execlp() instead of execl() to search the PATH for the ssh binary. This
avoids problems in case the ssh binary is installed in a different path.
This commit is contained in:
Stephan Gerhold
2024-06-11 19:47:48 +02:00
parent e799564f44
commit 828d76df63

2
cdba.c
View File

@@ -103,7 +103,7 @@ static int fork_ssh(const char *host, const char *cmd, int *pipes)
close(piped_stderr[0]);
close(piped_stderr[1]);
execl("/usr/bin/ssh", "ssh", host, cmd, NULL);
execlp("ssh", "ssh", host, cmd, NULL);
err(1, "launching ssh failed");
default:
close(piped_stdin[0]);