diff options
Diffstat (limited to 'readconf.c')
-rw-r--r-- | readconf.c | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/readconf.c b/readconf.c index 7173a8c23..963b706aa 100644 --- a/readconf.c +++ b/readconf.c | |||
@@ -107,6 +107,7 @@ typedef enum { | |||
107 | oAddressFamily, oGssAuthentication, oGssDelegateCreds, | 107 | oAddressFamily, oGssAuthentication, oGssDelegateCreds, |
108 | oServerAliveInterval, oServerAliveCountMax, oIdentitiesOnly, | 108 | oServerAliveInterval, oServerAliveCountMax, oIdentitiesOnly, |
109 | oSendEnv, oControlPath, oControlMaster, oHashKnownHosts, | 109 | oSendEnv, oControlPath, oControlMaster, oHashKnownHosts, |
110 | oProtocolKeepAlives, oSetupTimeOut, | ||
110 | oDeprecated, oUnsupported | 111 | oDeprecated, oUnsupported |
111 | } OpCodes; | 112 | } OpCodes; |
112 | 113 | ||
@@ -198,6 +199,8 @@ static struct { | |||
198 | { "controlpath", oControlPath }, | 199 | { "controlpath", oControlPath }, |
199 | { "controlmaster", oControlMaster }, | 200 | { "controlmaster", oControlMaster }, |
200 | { "hashknownhosts", oHashKnownHosts }, | 201 | { "hashknownhosts", oHashKnownHosts }, |
202 | { "protocolkeepalives", oProtocolKeepAlives }, | ||
203 | { "setuptimeout", oSetupTimeOut }, | ||
201 | { NULL, oBadOption } | 204 | { NULL, oBadOption } |
202 | }; | 205 | }; |
203 | 206 | ||
@@ -763,6 +766,7 @@ parse_int: | |||
763 | goto parse_flag; | 766 | goto parse_flag; |
764 | 767 | ||
765 | case oServerAliveInterval: | 768 | case oServerAliveInterval: |
769 | case oProtocolKeepAlives: /* Debian-specific compatibility alias */ | ||
766 | intptr = &options->server_alive_interval; | 770 | intptr = &options->server_alive_interval; |
767 | goto parse_time; | 771 | goto parse_time; |
768 | 772 | ||
@@ -797,6 +801,10 @@ parse_int: | |||
797 | intptr = &options->hash_known_hosts; | 801 | intptr = &options->hash_known_hosts; |
798 | goto parse_flag; | 802 | goto parse_flag; |
799 | 803 | ||
804 | case oSetupTimeOut: | ||
805 | intptr = &options->setuptimeout; | ||
806 | goto parse_int; | ||
807 | |||
800 | case oDeprecated: | 808 | case oDeprecated: |
801 | debug("%s line %d: Deprecated option \"%s\"", | 809 | debug("%s line %d: Deprecated option \"%s\"", |
802 | filename, linenum, keyword); | 810 | filename, linenum, keyword); |
@@ -902,6 +910,7 @@ initialize_options(Options * options) | |||
902 | options->strict_host_key_checking = -1; | 910 | options->strict_host_key_checking = -1; |
903 | options->compression = -1; | 911 | options->compression = -1; |
904 | options->tcp_keep_alive = -1; | 912 | options->tcp_keep_alive = -1; |
913 | options->setuptimeout = -1; | ||
905 | options->compression_level = -1; | 914 | options->compression_level = -1; |
906 | options->port = -1; | 915 | options->port = -1; |
907 | options->address_family = -1; | 916 | options->address_family = -1; |
@@ -958,7 +967,7 @@ fill_default_options(Options * options) | |||
958 | if (options->forward_x11 == -1) | 967 | if (options->forward_x11 == -1) |
959 | options->forward_x11 = 0; | 968 | options->forward_x11 = 0; |
960 | if (options->forward_x11_trusted == -1) | 969 | if (options->forward_x11_trusted == -1) |
961 | options->forward_x11_trusted = 0; | 970 | options->forward_x11_trusted = 1; |
962 | if (options->xauth_location == NULL) | 971 | if (options->xauth_location == NULL) |
963 | options->xauth_location = _PATH_XAUTH; | 972 | options->xauth_location = _PATH_XAUTH; |
964 | if (options->gateway_ports == -1) | 973 | if (options->gateway_ports == -1) |
@@ -1057,14 +1066,26 @@ fill_default_options(Options * options) | |||
1057 | options->rekey_limit = 0; | 1066 | options->rekey_limit = 0; |
1058 | if (options->verify_host_key_dns == -1) | 1067 | if (options->verify_host_key_dns == -1) |
1059 | options->verify_host_key_dns = 0; | 1068 | options->verify_host_key_dns = 0; |
1060 | if (options->server_alive_interval == -1) | 1069 | if (options->server_alive_interval == -1) { |
1061 | options->server_alive_interval = 0; | 1070 | /* in batch mode, default is 5mins */ |
1071 | if (options->batch_mode == 1) | ||
1072 | options->server_alive_interval = 300; | ||
1073 | else | ||
1074 | options->server_alive_interval = 0; | ||
1075 | } | ||
1062 | if (options->server_alive_count_max == -1) | 1076 | if (options->server_alive_count_max == -1) |
1063 | options->server_alive_count_max = 3; | 1077 | options->server_alive_count_max = 3; |
1064 | if (options->control_master == -1) | 1078 | if (options->control_master == -1) |
1065 | options->control_master = 0; | 1079 | options->control_master = 0; |
1066 | if (options->hash_known_hosts == -1) | 1080 | if (options->hash_known_hosts == -1) |
1067 | options->hash_known_hosts = 0; | 1081 | options->hash_known_hosts = 0; |
1082 | if (options->setuptimeout == -1) { | ||
1083 | /* in batch mode, default is 5mins */ | ||
1084 | if (options->batch_mode == 1) | ||
1085 | options->setuptimeout = 300; | ||
1086 | else | ||
1087 | options->setuptimeout = 0; | ||
1088 | } | ||
1068 | /* options->proxy_command should not be set by default */ | 1089 | /* options->proxy_command should not be set by default */ |
1069 | /* options->user will be set in the main program if appropriate */ | 1090 | /* options->user will be set in the main program if appropriate */ |
1070 | /* options->hostname will be set in the main program if appropriate */ | 1091 | /* options->hostname will be set in the main program if appropriate */ |