diff options
Diffstat (limited to 'readconf.c')
-rw-r--r-- | readconf.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/readconf.c b/readconf.c index 097d4082d..c2497638f 100644 --- a/readconf.c +++ b/readconf.c | |||
@@ -12,7 +12,7 @@ | |||
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include "includes.h" | 14 | #include "includes.h" |
15 | RCSID("$OpenBSD: readconf.c,v 1.100 2002/06/19 00:27:55 deraadt Exp $"); | 15 | RCSID("$OpenBSD: readconf.c,v 1.102 2003/02/05 09:02:28 markus Exp $"); |
16 | 16 | ||
17 | #include "ssh.h" | 17 | #include "ssh.h" |
18 | #include "xmalloc.h" | 18 | #include "xmalloc.h" |
@@ -116,6 +116,7 @@ typedef enum { | |||
116 | oDynamicForward, oPreferredAuthentications, oHostbasedAuthentication, | 116 | oDynamicForward, oPreferredAuthentications, oHostbasedAuthentication, |
117 | oHostKeyAlgorithms, oBindAddress, oSmartcardDevice, | 117 | oHostKeyAlgorithms, oBindAddress, oSmartcardDevice, |
118 | oClearAllForwardings, oNoHostAuthenticationForLocalhost, | 118 | oClearAllForwardings, oNoHostAuthenticationForLocalhost, |
119 | oEnableSSHKeysign, | ||
119 | oProtocolKeepAlives, oSetupTimeOut, | 120 | oProtocolKeepAlives, oSetupTimeOut, |
120 | oDeprecated | 121 | oDeprecated |
121 | } OpCodes; | 122 | } OpCodes; |
@@ -188,6 +189,7 @@ static struct { | |||
188 | { "bindaddress", oBindAddress }, | 189 | { "bindaddress", oBindAddress }, |
189 | { "smartcarddevice", oSmartcardDevice }, | 190 | { "smartcarddevice", oSmartcardDevice }, |
190 | { "clearallforwardings", oClearAllForwardings }, | 191 | { "clearallforwardings", oClearAllForwardings }, |
192 | { "enablesshkeysign", oEnableSSHKeysign }, | ||
191 | { "nohostauthenticationforlocalhost", oNoHostAuthenticationForLocalhost }, | 193 | { "nohostauthenticationforlocalhost", oNoHostAuthenticationForLocalhost }, |
192 | { "protocolkeepalives", oProtocolKeepAlives }, | 194 | { "protocolkeepalives", oProtocolKeepAlives }, |
193 | { "setuptimeout", oSetupTimeOut }, | 195 | { "setuptimeout", oSetupTimeOut }, |
@@ -271,14 +273,16 @@ parse_token(const char *cp, const char *filename, int linenum) | |||
271 | * Processes a single option line as used in the configuration files. This | 273 | * Processes a single option line as used in the configuration files. This |
272 | * only sets those values that have not already been set. | 274 | * only sets those values that have not already been set. |
273 | */ | 275 | */ |
276 | #define WHITESPACE " \t\r\n" | ||
274 | 277 | ||
275 | int | 278 | int |
276 | process_config_line(Options *options, const char *host, | 279 | process_config_line(Options *options, const char *host, |
277 | char *line, const char *filename, int linenum, | 280 | char *line, const char *filename, int linenum, |
278 | int *activep) | 281 | int *activep) |
279 | { | 282 | { |
280 | char buf[256], *s, *string, **charptr, *endofnumber, *keyword, *arg; | 283 | char buf[256], *s, **charptr, *endofnumber, *keyword, *arg; |
281 | int opcode, *intptr, value; | 284 | int opcode, *intptr, value; |
285 | size_t len; | ||
282 | u_short fwd_port, fwd_host_port; | 286 | u_short fwd_port, fwd_host_port; |
283 | char sfwd_host_port[6]; | 287 | char sfwd_host_port[6]; |
284 | 288 | ||
@@ -499,16 +503,9 @@ parse_string: | |||
499 | 503 | ||
500 | case oProxyCommand: | 504 | case oProxyCommand: |
501 | charptr = &options->proxy_command; | 505 | charptr = &options->proxy_command; |
502 | string = xstrdup(""); | 506 | len = strspn(s, WHITESPACE "="); |
503 | while ((arg = strdelim(&s)) != NULL && *arg != '\0') { | ||
504 | string = xrealloc(string, strlen(string) + strlen(arg) + 2); | ||
505 | strcat(string, " "); | ||
506 | strcat(string, arg); | ||
507 | } | ||
508 | if (*activep && *charptr == NULL) | 507 | if (*activep && *charptr == NULL) |
509 | *charptr = string; | 508 | *charptr = xstrdup(s + len); |
510 | else | ||
511 | xfree(string); | ||
512 | return 0; | 509 | return 0; |
513 | 510 | ||
514 | case oPort: | 511 | case oPort: |
@@ -682,6 +679,10 @@ parse_int: | |||
682 | *intptr = value; | 679 | *intptr = value; |
683 | break; | 680 | break; |
684 | 681 | ||
682 | case oEnableSSHKeysign: | ||
683 | intptr = &options->enable_ssh_keysign; | ||
684 | goto parse_flag; | ||
685 | |||
685 | case oDeprecated: | 686 | case oDeprecated: |
686 | debug("%s line %d: Deprecated option \"%s\"", | 687 | debug("%s line %d: Deprecated option \"%s\"", |
687 | filename, linenum, keyword); | 688 | filename, linenum, keyword); |
@@ -807,6 +808,7 @@ initialize_options(Options * options) | |||
807 | options->preferred_authentications = NULL; | 808 | options->preferred_authentications = NULL; |
808 | options->bind_address = NULL; | 809 | options->bind_address = NULL; |
809 | options->smartcard_device = NULL; | 810 | options->smartcard_device = NULL; |
811 | options->enable_ssh_keysign = - 1; | ||
810 | options->no_host_authentication_for_localhost = - 1; | 812 | options->no_host_authentication_for_localhost = - 1; |
811 | } | 813 | } |
812 | 814 | ||
@@ -930,6 +932,8 @@ fill_default_options(Options * options) | |||
930 | clear_forwardings(options); | 932 | clear_forwardings(options); |
931 | if (options->no_host_authentication_for_localhost == - 1) | 933 | if (options->no_host_authentication_for_localhost == - 1) |
932 | options->no_host_authentication_for_localhost = 0; | 934 | options->no_host_authentication_for_localhost = 0; |
935 | if (options->enable_ssh_keysign == -1) | ||
936 | options->enable_ssh_keysign = 0; | ||
933 | /* options->proxy_command should not be set by default */ | 937 | /* options->proxy_command should not be set by default */ |
934 | /* options->user will be set in the main program if appropriate */ | 938 | /* options->user will be set in the main program if appropriate */ |
935 | /* options->hostname will be set in the main program if appropriate */ | 939 | /* options->hostname will be set in the main program if appropriate */ |