summaryrefslogtreecommitdiff
path: root/readconf.c
diff options
context:
space:
mode:
Diffstat (limited to 'readconf.c')
-rw-r--r--readconf.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/readconf.c b/readconf.c
index 1df5ce2d9..899ff3f0e 100644
--- a/readconf.c
+++ b/readconf.c
@@ -81,6 +81,8 @@ RCSID("$OpenBSD: readconf.c,v 1.104 2003/04/01 10:22:21 markus Exp $");
81 RhostsRSAAuthentication yes 81 RhostsRSAAuthentication yes
82 StrictHostKeyChecking yes 82 StrictHostKeyChecking yes
83 KeepAlives no 83 KeepAlives no
84 ProtocolKeepAlives 0
85 SetupTimeOut 0
84 IdentityFile ~/.ssh/identity 86 IdentityFile ~/.ssh/identity
85 Port 22 87 Port 22
86 EscapeChar ~ 88 EscapeChar ~
@@ -115,6 +117,7 @@ typedef enum {
115 oHostKeyAlgorithms, oBindAddress, oSmartcardDevice, 117 oHostKeyAlgorithms, oBindAddress, oSmartcardDevice,
116 oClearAllForwardings, oNoHostAuthenticationForLocalhost, 118 oClearAllForwardings, oNoHostAuthenticationForLocalhost,
117 oEnableSSHKeysign, 119 oEnableSSHKeysign,
120 oProtocolKeepAlives, oSetupTimeOut,
118 oDeprecated 121 oDeprecated
119} OpCodes; 122} OpCodes;
120 123
@@ -188,6 +191,8 @@ static struct {
188 { "clearallforwardings", oClearAllForwardings }, 191 { "clearallforwardings", oClearAllForwardings },
189 { "enablesshkeysign", oEnableSSHKeysign }, 192 { "enablesshkeysign", oEnableSSHKeysign },
190 { "nohostauthenticationforlocalhost", oNoHostAuthenticationForLocalhost }, 193 { "nohostauthenticationforlocalhost", oNoHostAuthenticationForLocalhost },
194 { "protocolkeepalives", oProtocolKeepAlives },
195 { "setuptimeout", oSetupTimeOut },
191 { NULL, oBadOption } 196 { NULL, oBadOption }
192}; 197};
193 198
@@ -281,6 +286,13 @@ process_config_line(Options *options, const char *host,
281 u_short fwd_port, fwd_host_port; 286 u_short fwd_port, fwd_host_port;
282 char sfwd_host_port[6]; 287 char sfwd_host_port[6];
283 288
289 /* Strip trailing whitespace */
290 for(len = strlen(line) - 1; len > 0; len--) {
291 if (strchr(WHITESPACE, line[len]) == NULL)
292 break;
293 line[len] = '\0';
294 }
295
284 s = line; 296 s = line;
285 /* Get the keyword. (Each line is supposed to begin with a keyword). */ 297 /* Get the keyword. (Each line is supposed to begin with a keyword). */
286 keyword = strdelim(&s); 298 keyword = strdelim(&s);
@@ -415,6 +427,14 @@ parse_flag:
415 intptr = &options->no_host_authentication_for_localhost; 427 intptr = &options->no_host_authentication_for_localhost;
416 goto parse_flag; 428 goto parse_flag;
417 429
430 case oProtocolKeepAlives:
431 intptr = &options->protocolkeepalives;
432 goto parse_int;
433
434 case oSetupTimeOut:
435 intptr = &options->setuptimeout;
436 goto parse_int;
437
418 case oNumberOfPasswordPrompts: 438 case oNumberOfPasswordPrompts:
419 intptr = &options->number_of_password_prompts; 439 intptr = &options->number_of_password_prompts;
420 goto parse_int; 440 goto parse_int;
@@ -767,6 +787,8 @@ initialize_options(Options * options)
767 options->strict_host_key_checking = -1; 787 options->strict_host_key_checking = -1;
768 options->compression = -1; 788 options->compression = -1;
769 options->keepalives = -1; 789 options->keepalives = -1;
790 options->protocolkeepalives = -1;
791 options->setuptimeout = -1;
770 options->compression_level = -1; 792 options->compression_level = -1;
771 options->port = -1; 793 options->port = -1;
772 options->connection_attempts = -1; 794 options->connection_attempts = -1;
@@ -855,6 +877,14 @@ fill_default_options(Options * options)
855 options->compression = 0; 877 options->compression = 0;
856 if (options->keepalives == -1) 878 if (options->keepalives == -1)
857 options->keepalives = 1; 879 options->keepalives = 1;
880 if (options->protocolkeepalives == -1){
881 if (options->batch_mode == 1) /*in batch mode, default is 5mins */
882 options->protocolkeepalives = 300;
883 else options->protocolkeepalives = 0;}
884 if (options->setuptimeout == -1){
885 if (options->batch_mode == 1) /*in batch mode, default is 5mins */
886 options->setuptimeout = 300;
887 else options->setuptimeout = 0;}
858 if (options->compression_level == -1) 888 if (options->compression_level == -1)
859 options->compression_level = 6; 889 options->compression_level = 6;
860 if (options->port == -1) 890 if (options->port == -1)