From 828d76df637e9f8d7b9d5d7d6750aad7fc451d9d Mon Sep 17 00:00:00 2001 From: Stephan Gerhold Date: Tue, 11 Jun 2024 19:47:48 +0200 Subject: [PATCH] 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. --- cdba.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cdba.c b/cdba.c index a526fad..8595fa4 100644 --- a/cdba.c +++ b/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]);