From 7beeb9e61b7f18a8c2e9aa015958cffde9b76c05 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Fri, 16 Apr 2021 10:31:30 +0200 Subject: Use execlp("sh") instead of execl("/bin/sh") This stops assuming the POSIX shell command is located in /bin. --- sway/swaynag.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sway/swaynag.c') diff --git a/sway/swaynag.c b/sway/swaynag.c index db5a919a..ba582989 100644 --- a/sway/swaynag.c +++ b/sway/swaynag.c @@ -87,8 +87,8 @@ bool swaynag_spawn(const char *swaynag_command, size_t length = strlen(swaynag_command) + strlen(swaynag->args) + 2; char *cmd = malloc(length); snprintf(cmd, length, "%s %s", swaynag_command, swaynag->args); - execl("/bin/sh", "/bin/sh", "-c", cmd, NULL); - sway_log_errno(SWAY_ERROR, "execl failed"); + execlp("sh", "sh", "-c", cmd, NULL); + sway_log_errno(SWAY_ERROR, "execlp failed"); _exit(EXIT_FAILURE); } _exit(EXIT_SUCCESS); -- cgit v1.2.3-54-g00ecf