mirror of
https://github.com/KeyZox71/ft_minipowershell.git
synced 2025-05-11 23:18:46 +02:00
「✨」 feat: Added security to redirection fd
This commit is contained in:
30
src/parsing/check_error/check_redir.c
Normal file
30
src/parsing/check_error/check_redir.c
Normal file
@ -0,0 +1,30 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* check_redir.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/07/09 16:32:21 by adjoly #+# #+# */
|
||||
/* Updated: 2024/07/09 16:39:44 by adjoly ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "parsing.h"
|
||||
#include "error_msg.h"
|
||||
|
||||
bool check_redir(t_list *list)
|
||||
{
|
||||
t_list *tmp;
|
||||
t_cmd *cmd;
|
||||
|
||||
tmp = list;
|
||||
while (tmp)
|
||||
{
|
||||
cmd = (t_cmd *)tmp->content;
|
||||
if (cmd->infile == -1 || cmd->outfile == -1)
|
||||
return (send_error_parsing(ERROR_NO_FILE));
|
||||
tmp = tmp->next;
|
||||
}
|
||||
return (false);
|
||||
}
|
Reference in New Issue
Block a user