summaryrefslogtreecommitdiffstats
path: root/ssh.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2023-10-12 00:42:26 +0200
committerDamien Miller <djm@mindrot.org>2023-10-12 01:00:13 +0200
commita752a6c0e1001f93696d7025f0c867f0376e2ecf (patch)
treedbe5b78436bc288efe6f458e167864f38056f768 /ssh.c
parentupstream: add support for reading ED25519 private keys in PEM PKCS8 (diff)
downloadopenssh-a752a6c0e1001f93696d7025f0c867f0376e2ecf.tar.xz
openssh-a752a6c0e1001f93696d7025f0c867f0376e2ecf.zip
upstream: add ChannelTimeout support to the client, mirroring the
same option in the server. ok markus@ OpenBSD-Commit-ID: 55630b26f390ac063980cfe7ad8c54b03284ef02
Diffstat (limited to 'ssh.c')
-rw-r--r--ssh.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/ssh.c b/ssh.c
index 1dbbda7d6..8b8c595e5 100644
--- a/ssh.c
+++ b/ssh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh.c,v 1.594 2023/09/03 23:59:32 djm Exp $ */
+/* $OpenBSD: ssh.c,v 1.595 2023/10/11 22:42:26 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1573,6 +1573,20 @@ main(int ac, char **av)
else
timeout_ms = options.connection_timeout * 1000;
+ /* Apply channels timeouts, if set */
+ channel_clear_timeouts(ssh);
+ for (j = 0; j < options.num_channel_timeouts; j++) {
+ debug3("applying channel timeout %s",
+ options.channel_timeouts[j]);
+ if (parse_pattern_interval(options.channel_timeouts[j],
+ &cp, &i) != 0) {
+ fatal_f("internal error: bad timeout %s",
+ options.channel_timeouts[j]);
+ }
+ channel_add_timeout(ssh, cp, i);
+ free(cp);
+ }
+
/* Open a connection to the remote host. */
if (ssh_connect(ssh, host, options.host_arg, addrs, &hostaddr,
options.port, options.connection_attempts,