From 90678d8f0f26729e7dde98b7d044884e285975b9 Mon Sep 17 00:00:00 2001 From: Quinten Mennen Date: Thu, 27 Feb 2025 13:09:30 +0100 Subject: [PATCH] check if the path found is executable --- src/executor/executor_child.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/executor/executor_child.c b/src/executor/executor_child.c index 904bedd..299b77c 100644 --- a/src/executor/executor_child.c +++ b/src/executor/executor_child.c @@ -22,7 +22,7 @@ void executor_child(t_minishell *msh, t_command *command) dup2(command->fd_out, 1); executor_close_fds(command->n_fds); path = executor_absolute_path(msh, command->args[0]); - if (path == NULL) + if (path == NULL || !access(path, F_OK | X_OK)) { ft_putstr_fd(RED BOLD, 2); ft_putstr_fd(command->args[0], 2);