summaryrefslogtreecommitdiff
path: root/util-linux/script.c
diff options
context:
space:
mode:
Diffstat (limited to 'util-linux/script.c')
-rw-r--r--util-linux/script.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/util-linux/script.c b/util-linux/script.c
index 8fb991d..abcd73b 100644
--- a/util-linux/script.c
+++ b/util-linux/script.c
@@ -77,8 +77,15 @@ int script_main(int argc UNUSED_PARAM, char **argv)
if (!(opt & OPT_q)) {
printf("Script started, file is %s\n", fname);
}
+
shell = get_shell_name();
+ /* Some people run "script ... 0>&-".
+ * Our code assumes that STDIN_FILENO != pty.
+ * Ensure STDIN_FILENO is not closed:
+ */
+ bb_sanitize_stdio();
+
pty = xgetpty(pty_line);
/* get current stdin's tty params */