sync code with last fixes and improvements from OpenBSD

This commit is contained in:
purplerain 2023-07-27 09:35:44 +00:00
parent 58df21ce75
commit f960599e67
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
399 changed files with 7016 additions and 6902 deletions

View file

@ -1,4 +1,4 @@
/* $OpenBSD: mux.c,v 1.97 2023/06/20 23:59:33 djm Exp $ */
/* $OpenBSD: mux.c,v 1.98 2023/07/26 23:06:00 djm Exp $ */
/*
* Copyright (c) 2002-2008 Damien Miller <djm@openbsd.org>
*
@ -1862,7 +1862,7 @@ mux_client_request_session(int fd)
const char *term = NULL;
u_int i, echar, rid, sid, esid, exitval, type, exitval_seen;
extern char **environ;
int r, rawmode;
int r, rawmode = 0;
debug3_f("entering");
@ -1971,9 +1971,15 @@ mux_client_request_session(int fd)
ssh_signal(SIGTERM, control_client_sighandler);
ssh_signal(SIGWINCH, control_client_sigrelay);
rawmode = tty_flag;
if (tty_flag)
enter_raw_mode(options.request_tty == REQUEST_TTY_FORCE);
if (options.fork_after_authentication)
daemon(1, 1);
else {
rawmode = tty_flag;
if (tty_flag) {
enter_raw_mode(
options.request_tty == REQUEST_TTY_FORCE);
}
}
/*
* Stick around until the controlee closes the client_fd.