[openssh-commits] [openssh] 04/06: upstream commit

git+noreply at mindrot.org git+noreply at mindrot.org
Fri Jul 22 13:36:47 AEST 2016


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit 324583e8fb3935690be58790425793df619c6d4d
Author: naddy at openbsd.org <naddy at openbsd.org>
Date:   Wed Jul 20 10:45:27 2016 +0000

    upstream commit
    
    Do not clobber the global jump_host variables when
    parsing an inactive configuration.  ok djm@
    
    Upstream-ID: 5362210944d91417d5976346d41ac0b244350d31
---
 readconf.c | 27 +++++++++++++++------------
 1 file changed, 15 insertions(+), 12 deletions(-)

diff --git a/readconf.c b/readconf.c
index cb2999d..8b5b219 100644
--- a/readconf.c
+++ b/readconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: readconf.c,v 1.257 2016/07/15 00:24:30 djm Exp $ */
+/* $OpenBSD: readconf.c,v 1.258 2016/07/20 10:45:27 naddy Exp $ */
 /*
  * Author: Tatu Ylonen <ylo at cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
@@ -2286,13 +2286,14 @@ parse_jump(const char *s, Options *o, int active)
 {
 	char *orig, *sdup, *cp;
 	char *host = NULL, *user = NULL;
-	int ret = -1, port = -1;
+	int ret = -1, port = -1, first;
 
 	active &= o->proxy_command == NULL && o->jump_host == NULL;
 
 	orig = sdup = xstrdup(s);
+	first = active;
 	while ((cp = strsep(&sdup, ",")) && cp != NULL) {
-		if (active) {
+		if (first) {
 			/* First argument and configuration is active */
 			if (parse_user_host_port(cp, &user, &host, &port) != 0)
 				goto out;
@@ -2301,19 +2302,21 @@ parse_jump(const char *s, Options *o, int active)
 			if (parse_user_host_port(cp, NULL, NULL, NULL) != 0)
 				goto out;
 		}
-		active = 0; /* only check syntax for subsequent hosts */
+		first = 0; /* only check syntax for subsequent hosts */
 	}
 	/* success */
-	free(orig);
-	o->jump_user = user;
-	o->jump_host = host;
-	o->jump_port = port;
-	o->proxy_command = xstrdup("none");
-	user = host = NULL;
-	if ((cp = strchr(s, ',')) != NULL && cp[1] != '\0')
-		o->jump_extra = xstrdup(cp + 1);
+	if (active) {
+		o->jump_user = user;
+		o->jump_host = host;
+		o->jump_port = port;
+		o->proxy_command = xstrdup("none");
+		user = host = NULL;
+		if ((cp = strchr(s, ',')) != NULL && cp[1] != '\0')
+			o->jump_extra = xstrdup(cp + 1);
+	}
 	ret = 0;
  out:
+	free(orig);
 	free(user);
 	free(host);
 	return ret;

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list