mirror of
https://github.com/linux-msm/cdba.git
synced 2026-02-25 13:11:56 -08:00
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:
2
cdba.c
2
cdba.c
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user