check if the path found is executable

This commit is contained in:
Quinten Mennen 2025-02-27 13:09:30 +01:00
parent 3b1ad5500b
commit 90678d8f0f

View File

@ -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);