=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/ssh.c,v retrieving revision 1.562 retrieving revision 1.563 diff -u -r1.562 -r1.563 --- src/usr.bin/ssh/ssh.c 2021/07/17 00:38:11 1.562 +++ src/usr.bin/ssh/ssh.c 2021/07/23 04:00:59 1.563 @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh.c,v 1.562 2021/07/17 00:38:11 djm Exp $ */ +/* $OpenBSD: ssh.c,v 1.563 2021/07/23 04:00:59 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -111,12 +111,6 @@ int tty_flag = 0; /* - * Flag indicating that nothing should be read from stdin. This can be set - * on the command line. - */ -int stdin_null_flag = 0; - -/* * Flag indicating that the current process should be backgrounded and * a new mux-client launched in the foreground for ControlPersist. */ @@ -697,11 +691,11 @@ options.address_family = AF_INET6; break; case 'n': - stdin_null_flag = 1; + options.stdin_null = 1; break; case 'f': fork_after_authentication_flag = 1; - stdin_null_flag = 1; + options.stdin_null = 1; break; case 'x': options.forward_x11 = 0; @@ -1336,7 +1330,7 @@ (muxclient_command && muxclient_command != SSHMUX_COMMAND_PROXY)) tty_flag = 0; /* Do not allocate a tty if stdin is not a tty. */ - if ((!isatty(fileno(stdin)) || stdin_null_flag) && + if ((!isatty(fileno(stdin)) || options.stdin_null) && options.request_tty != REQUEST_TTY_FORCE) { if (tty_flag) logit("Pseudo-terminal will not be allocated because " @@ -1713,7 +1707,7 @@ default: /* Parent: set up mux client to connect to backgrounded master */ debug2_f("background process is %ld", (long)pid); - stdin_null_flag = ostdin_null_flag; + options.stdin_null = ostdin_null_flag; options.request_tty = orequest_tty; tty_flag = otty_flag; options.session_type = osession_type; @@ -2054,7 +2048,7 @@ Channel *c; int window, packetmax, in, out, err; - if (stdin_null_flag) { + if (options.stdin_null) { in = open(_PATH_DEVNULL, O_RDONLY); } else { in = dup(STDIN_FILENO); @@ -2123,11 +2117,11 @@ * async rfwd replies have been received for ExitOnForwardFailure). */ if (options.control_persist && muxserver_sock != -1) { - ostdin_null_flag = stdin_null_flag; + ostdin_null_flag = options.stdin_null; osession_type = options.session_type; orequest_tty = options.request_tty; otty_flag = tty_flag; - stdin_null_flag = 1; + options.stdin_null = 1; options.session_type = SESSION_TYPE_NONE; tty_flag = 0; if (!fork_after_authentication_flag &&