mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-08 10:51:15 -03:00
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:
8
io.h
8
io.h
@@ -66,11 +66,15 @@ class io_fd_t : public io_data_t
|
||||
/** fd to redirect specified fd to. For example, in 2>&1, old_fd is 1, and io_data_t::fd is 2 */
|
||||
const int old_fd;
|
||||
|
||||
/** Whether this redirection was supplied by a script. For example, 'cmd <&3' would have user_supplied set to true. But a redirection that comes about through transmogrification would not. */
|
||||
const bool user_supplied;
|
||||
|
||||
virtual void print() const;
|
||||
|
||||
io_fd_t(int f, int old) :
|
||||
io_fd_t(int f, int old, bool us) :
|
||||
io_data_t(IO_FD, f),
|
||||
old_fd(old)
|
||||
old_fd(old),
|
||||
user_supplied(us)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user