Ignore user-supplied fd redirections above 2 for builtins

Prevents e.g. specifying an fd which corresponds to the history file
as the stdin for builtin_source
This commit is contained in:
ridiculousfish
2015-01-08 10:44:05 -08:00
parent 7864d0d416
commit 34db67680d
3 changed files with 14 additions and 6 deletions

View File

@@ -1083,7 +1083,7 @@ bool parse_execution_context_t::determine_io_chain(const parse_node_t &statement
}
else
{
new_io.reset(new io_fd_t(source_fd, old_fd));
new_io.reset(new io_fd_t(source_fd, old_fd, true));
}
}
break;