summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2003-02-24 11:56:27 +1100
committerDamien Miller <djm@mindrot.org>2003-02-24 11:56:27 +1100
commit61f08ac35a06e758c20fc85b9944d1feee146d47 (patch)
tree87e2fab27a2a91d8ed30d931828c238c2c4b20ec
parentb7df3af154d035be480b9d9f433f440f1c66e1bd (diff)
- markus@cvs.openbsd.org 2003/02/05 09:02:28
[readconf.c] simplify ProxyCommand parsing, remove strcat/xrealloc; ok henning@, djm@
-rw-r--r--ChangeLog5
-rw-r--r--readconf.c17
2 files changed, 10 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 0ba9fe7a5..8fe2de974 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -39,6 +39,9 @@
39 [monitor.c monitor_wrap.c] 39 [monitor.c monitor_wrap.c]
40 skey/bsdauth: use 0 to indicate failure instead of -1, because 40 skey/bsdauth: use 0 to indicate failure instead of -1, because
41 the buffer API only supports unsigned ints. 41 the buffer API only supports unsigned ints.
42 - markus@cvs.openbsd.org 2003/02/05 09:02:28
43 [readconf.c]
44 simplify ProxyCommand parsing, remove strcat/xrealloc; ok henning@, djm@
42 45
4320030211 4620030211
44 - (djm) Cygwin needs libcrypt too. Patch from vinschen@redhat.com 47 - (djm) Cygwin needs libcrypt too. Patch from vinschen@redhat.com
@@ -1139,4 +1142,4 @@
1139 save auth method before monitor_reset_key_state(); bugzilla bug #284; 1142 save auth method before monitor_reset_key_state(); bugzilla bug #284;
1140 ok provos@ 1143 ok provos@
1141 1144
1142$Id: ChangeLog,v 1.2603 2003/02/24 00:55:46 djm Exp $ 1145$Id: ChangeLog,v 1.2604 2003/02/24 00:56:27 djm Exp $
diff --git a/readconf.c b/readconf.c
index b9f1b7ddc..8b576a7ad 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.101 2002/11/07 22:08:07 markus Exp $"); 15RCSID("$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"
@@ -268,14 +268,16 @@ parse_token(const char *cp, const char *filename, int linenum)
268 * Processes a single option line as used in the configuration files. This 268 * Processes a single option line as used in the configuration files. This
269 * only sets those values that have not already been set. 269 * only sets those values that have not already been set.
270 */ 270 */
271#define WHITESPACE " \t\r\n"
271 272
272int 273int
273process_config_line(Options *options, const char *host, 274process_config_line(Options *options, const char *host,
274 char *line, const char *filename, int linenum, 275 char *line, const char *filename, int linenum,
275 int *activep) 276 int *activep)
276{ 277{
277 char buf[256], *s, *string, **charptr, *endofnumber, *keyword, *arg; 278 char buf[256], *s, **charptr, *endofnumber, *keyword, *arg;
278 int opcode, *intptr, value; 279 int opcode, *intptr, value;
280 size_t len;
279 u_short fwd_port, fwd_host_port; 281 u_short fwd_port, fwd_host_port;
280 char sfwd_host_port[6]; 282 char sfwd_host_port[6];
281 283
@@ -488,16 +490,9 @@ parse_string:
488 490
489 case oProxyCommand: 491 case oProxyCommand:
490 charptr = &options->proxy_command; 492 charptr = &options->proxy_command;
491 string = xstrdup(""); 493 len = strspn(s, WHITESPACE "=");
492 while ((arg = strdelim(&s)) != NULL && *arg != '\0') {
493 string = xrealloc(string, strlen(string) + strlen(arg) + 2);
494 strcat(string, " ");
495 strcat(string, arg);
496 }
497 if (*activep && *charptr == NULL) 494 if (*activep && *charptr == NULL)
498 *charptr = string; 495 *charptr = xstrdup(s + len);
499 else
500 xfree(string);
501 return 0; 496 return 0;
502 497
503 case oPort: 498 case oPort: