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 8ace1bbd4..6c0511519 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 | ||
@@ -765,6 +768,7 @@ parse_int: | |||
765 | goto parse_flag; | 768 | goto parse_flag; |
766 | 769 | ||
767 | case oServerAliveInterval: | 770 | case oServerAliveInterval: |
771 | case oProtocolKeepAlives: /* Debian-specific compatibility alias */ | ||
768 | intptr = &options->server_alive_interval; | 772 | intptr = &options->server_alive_interval; |
769 | goto parse_time; | 773 | goto parse_time; |
770 | 774 | ||
@@ -799,6 +803,10 @@ parse_int: | |||
799 | intptr = &options->hash_known_hosts; | 803 | intptr = &options->hash_known_hosts; |
800 | goto parse_flag; | 804 | goto parse_flag; |
801 | 805 | ||
806 | case oSetupTimeOut: | ||
807 | intptr = &options->setuptimeout; | ||
808 | goto parse_int; | ||
809 | |||
802 | case oDeprecated: | 810 | case oDeprecated: |
803 | debug("%s line %d: Deprecated option \"%s\"", | 811 | debug("%s line %d: Deprecated option \"%s\"", |
804 | filename, linenum, keyword); | 812 | filename, linenum, keyword); |
@@ -904,6 +912,7 @@ initialize_options(Options * options) | |||
904 | options->strict_host_key_checking = -1; | 912 | options->strict_host_key_checking = -1; |
905 | options->compression = -1; | 913 | options->compression = -1; |
906 | options->tcp_keep_alive = -1; | 914 | options->tcp_keep_alive = -1; |
915 | options->setuptimeout = -1; | ||
907 | options->compression_level = -1; | 916 | options->compression_level = -1; |
908 | options->port = -1; | 917 | options->port = -1; |
909 | options->address_family = -1; | 918 | options->address_family = -1; |
@@ -960,7 +969,7 @@ fill_default_options(Options * options) | |||
960 | if (options->forward_x11 == -1) | 969 | if (options->forward_x11 == -1) |
961 | options->forward_x11 = 0; | 970 | options->forward_x11 = 0; |
962 | if (options->forward_x11_trusted == -1) | 971 | if (options->forward_x11_trusted == -1) |
963 | options->forward_x11_trusted = 0; | 972 | options->forward_x11_trusted = 1; |
964 | if (options->xauth_location == NULL) | 973 | if (options->xauth_location == NULL) |
965 | options->xauth_location = _PATH_XAUTH; | 974 | options->xauth_location = _PATH_XAUTH; |
966 | if (options->gateway_ports == -1) | 975 | if (options->gateway_ports == -1) |
@@ -1059,14 +1068,26 @@ fill_default_options(Options * options) | |||
1059 | options->rekey_limit = 0; | 1068 | options->rekey_limit = 0; |
1060 | if (options->verify_host_key_dns == -1) | 1069 | if (options->verify_host_key_dns == -1) |
1061 | options->verify_host_key_dns = 0; | 1070 | options->verify_host_key_dns = 0; |
1062 | if (options->server_alive_interval == -1) | 1071 | if (options->server_alive_interval == -1) { |
1063 | options->server_alive_interval = 0; | 1072 | /* in batch mode, default is 5mins */ |
1073 | if (options->batch_mode == 1) | ||
1074 | options->server_alive_interval = 300; | ||
1075 | else | ||
1076 | options->server_alive_interval = 0; | ||
1077 | } | ||
1064 | if (options->server_alive_count_max == -1) | 1078 | if (options->server_alive_count_max == -1) |
1065 | options->server_alive_count_max = 3; | 1079 | options->server_alive_count_max = 3; |
1066 | if (options->control_master == -1) | 1080 | if (options->control_master == -1) |
1067 | options->control_master = 0; | 1081 | options->control_master = 0; |
1068 | if (options->hash_known_hosts == -1) | 1082 | if (options->hash_known_hosts == -1) |
1069 | options->hash_known_hosts = 0; | 1083 | options->hash_known_hosts = 0; |
1084 | if (options->setuptimeout == -1) { | ||
1085 | /* in batch mode, default is 5mins */ | ||
1086 | if (options->batch_mode == 1) | ||
1087 | options->setuptimeout = 300; | ||
1088 | else | ||
1089 | options->setuptimeout = 0; | ||
1090 | } | ||
1070 | /* options->proxy_command should not be set by default */ | 1091 | /* options->proxy_command should not be set by default */ |
1071 | /* options->user will be set in the main program if appropriate */ | 1092 | /* options->user will be set in the main program if appropriate */ |
1072 | /* options->hostname will be set in the main program if appropriate */ | 1093 | /* options->hostname will be set in the main program if appropriate */ |