aboutsummaryrefslogtreecommitdiffstats
path: root/swaynag
diff options
context:
space:
mode:
authorLibravatar Simon Ser <contact@emersion.fr>2021-04-16 10:31:30 +0200
committerLibravatar Kenny Levinsen <kl@kl.wtf>2021-04-22 23:12:49 +0200
commit7beeb9e61b7f18a8c2e9aa015958cffde9b76c05 (patch)
tree78290c40b4cd40e87652387ca9fc8c45b73b857b /swaynag
parentAvoid creating zero-sized textures for marks (diff)
downloadsway-7beeb9e61b7f18a8c2e9aa015958cffde9b76c05.tar.gz
sway-7beeb9e61b7f18a8c2e9aa015958cffde9b76c05.tar.zst
sway-7beeb9e61b7f18a8c2e9aa015958cffde9b76c05.zip
Use execlp("sh") instead of execl("/bin/sh")
This stops assuming the POSIX shell command is located in /bin.
Diffstat (limited to 'swaynag')
-rw-r--r--swaynag/swaynag.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/swaynag/swaynag.c b/swaynag/swaynag.c
index 1d1dbee2..609e4831 100644
--- a/swaynag/swaynag.c
+++ b/swaynag/swaynag.c
@@ -30,8 +30,8 @@ static bool terminal_execute(char *terminal, char *command) {
30 chmod(fname, S_IRUSR | S_IWUSR | S_IXUSR); 30 chmod(fname, S_IRUSR | S_IWUSR | S_IXUSR);
31 char *cmd = malloc(sizeof(char) * (strlen(terminal) + strlen(" -e ") + strlen(fname) + 1)); 31 char *cmd = malloc(sizeof(char) * (strlen(terminal) + strlen(" -e ") + strlen(fname) + 1));
32 sprintf(cmd, "%s -e %s", terminal, fname); 32 sprintf(cmd, "%s -e %s", terminal, fname);
33 execl("/bin/sh", "/bin/sh", "-c", cmd, NULL); 33 execlp("sh", "sh", "-c", cmd, NULL);
34 sway_log_errno(SWAY_ERROR, "Failed to run command, execl() returned."); 34 sway_log_errno(SWAY_ERROR, "Failed to run command, execlp() returned.");
35 free(cmd); 35 free(cmd);
36 return false; 36 return false;
37} 37}
@@ -69,8 +69,8 @@ static void swaynag_button_execute(struct swaynag *swaynag,
69 sway_log(SWAY_DEBUG, 69 sway_log(SWAY_DEBUG,
70 "$TERMINAL not found. Running directly"); 70 "$TERMINAL not found. Running directly");
71 } 71 }
72 execl("/bin/sh", "/bin/sh", "-c", button->action, NULL); 72 execlp("sh", "sh", "-c", button->action, NULL);
73 sway_log_errno(SWAY_DEBUG, "execl failed"); 73 sway_log_errno(SWAY_DEBUG, "execlp failed");
74 _exit(EXIT_FAILURE); 74 _exit(EXIT_FAILURE);
75 } 75 }
76 } 76 }