summaryrefslogtreecommitdiff
path: root/readconf.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2003-05-16 11:39:04 +1000
committerDamien Miller <djm@mindrot.org>2003-05-16 11:39:04 +1000
commitb78d5eb6c58d54fb9972afe487ad94e63cc7d5c7 (patch)
tree8f40c7da74a5718e2d4c69919c2211049bcb0f77 /readconf.c
parent99b4b88aba7131f04439ac6baaaae4dde02aa965 (diff)
- djm@cvs.openbsd.org 2003/05/15 14:55:25
[readconf.c readconf.h ssh_config ssh_config.5 sshconnect.c] add a ConnectTimeout option to ssh, based on patch from Jean-Charles Longuet (jclonguet at free.fr); portable #207 ok markus@
Diffstat (limited to 'readconf.c')
-rw-r--r--readconf.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/readconf.c b/readconf.c
index fee7a8993..a0cf3d687 100644
--- a/readconf.c
+++ b/readconf.c
@@ -12,7 +12,7 @@
12 */ 12 */
13 13
14#include "includes.h" 14#include "includes.h"
15RCSID("$OpenBSD: readconf.c,v 1.110 2003/05/15 14:02:47 jakob Exp $"); 15RCSID("$OpenBSD: readconf.c,v 1.111 2003/05/15 14:55:25 djm Exp $");
16 16
17#include "ssh.h" 17#include "ssh.h"
18#include "xmalloc.h" 18#include "xmalloc.h"
@@ -106,7 +106,7 @@ typedef enum {
106 oDynamicForward, oPreferredAuthentications, oHostbasedAuthentication, 106 oDynamicForward, oPreferredAuthentications, oHostbasedAuthentication,
107 oHostKeyAlgorithms, oBindAddress, oSmartcardDevice, 107 oHostKeyAlgorithms, oBindAddress, oSmartcardDevice,
108 oClearAllForwardings, oNoHostAuthenticationForLocalhost, 108 oClearAllForwardings, oNoHostAuthenticationForLocalhost,
109 oEnableSSHKeysign, oRekeyLimit, oVerifyHostKeyDNS, 109 oEnableSSHKeysign, oRekeyLimit, oVerifyHostKeyDNS, oConnectTimeout,
110 oDeprecated, oUnsupported 110 oDeprecated, oUnsupported
111} OpCodes; 111} OpCodes;
112 112
@@ -193,6 +193,7 @@ static struct {
193#endif 193#endif
194 { "nohostauthenticationforlocalhost", oNoHostAuthenticationForLocalhost }, 194 { "nohostauthenticationforlocalhost", oNoHostAuthenticationForLocalhost },
195 { "rekeylimit", oRekeyLimit }, 195 { "rekeylimit", oRekeyLimit },
196 { "connecttimeout", oConnectTimeout },
196 { NULL, oBadOption } 197 { NULL, oBadOption }
197}; 198};
198 199
@@ -309,6 +310,20 @@ process_config_line(Options *options, const char *host,
309 /* don't panic, but count bad options */ 310 /* don't panic, but count bad options */
310 return -1; 311 return -1;
311 /* NOTREACHED */ 312 /* NOTREACHED */
313 case oConnectTimeout:
314 intptr = &options->connection_timeout;
315/* parse_time: */
316 arg = strdelim(&s);
317 if (!arg || *arg == '\0')
318 fatal("%s line %d: missing time value.",
319 filename, linenum);
320 if ((value = convtime(arg)) == -1)
321 fatal("%s line %d: invalid time value.",
322 filename, linenum);
323 if (*intptr == -1)
324 *intptr = value;
325 break;
326
312 case oForwardAgent: 327 case oForwardAgent:
313 intptr = &options->forward_agent; 328 intptr = &options->forward_agent;
314parse_flag: 329parse_flag:
@@ -808,6 +823,7 @@ initialize_options(Options * options)
808 options->compression_level = -1; 823 options->compression_level = -1;
809 options->port = -1; 824 options->port = -1;
810 options->connection_attempts = -1; 825 options->connection_attempts = -1;
826 options->connection_timeout = -1;
811 options->number_of_password_prompts = -1; 827 options->number_of_password_prompts = -1;
812 options->cipher = -1; 828 options->cipher = -1;
813 options->ciphers = NULL; 829 options->ciphers = NULL;