summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2023-09-03 23:59:32 +0000
committerDamien Miller <djm@mindrot.org>2023-09-04 10:09:52 +1000
commit43254b326ac6e2131dbd750f9464dc62c14bd5a7 (patch)
treec3a974ac6462581538e17cfebfb3a820e9fceacb
parentff3eda68ceb2e2bb8f48e3faceb96076c3e85c20 (diff)
upstream: set interactive mode for ControlPersist sessions if they
originally requested a tty; enables keystroke timing obfuscation for most ControlPersist sessions. Spotted by naddy@ OpenBSD-Commit-ID: 72783a26254202e2f3f41a2818a19956fe49a772
-rw-r--r--ssh.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/ssh.c b/ssh.c
index caf3c692..1dbbda7d 100644
--- a/ssh.c
+++ b/ssh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh.c,v 1.593 2023/07/26 23:06:00 djm Exp $ */
+/* $OpenBSD: ssh.c,v 1.594 2023/09/03 23:59:32 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -2140,7 +2140,7 @@ ssh_session2_open(struct ssh *ssh)
static int
ssh_session2(struct ssh *ssh, const struct ssh_conn_info *cinfo)
{
- int r, id = -1;
+ int r, interactive, id = -1;
char *cp, *tun_fwd_ifname = NULL;
/* XXX should be pre-session */
@@ -2197,8 +2197,11 @@ ssh_session2(struct ssh *ssh, const struct ssh_conn_info *cinfo)
if (options.session_type != SESSION_TYPE_NONE)
id = ssh_session2_open(ssh);
else {
- ssh_packet_set_interactive(ssh,
- options.control_master == SSHCTL_MASTER_NO,
+ interactive = options.control_master == SSHCTL_MASTER_NO;
+ /* ControlPersist may have clobbered ControlMaster, so check */
+ if (need_controlpersist_detach)
+ interactive = otty_flag != 0;
+ ssh_packet_set_interactive(ssh, interactive,
options.ip_qos_interactive, options.ip_qos_bulk);
}