[PATCH] Allow "ProxyCommand none" in ssh_config

Thomas Binder binder at arago.de
Tue Oct 1 05:05:21 EST 2002


Hi!

As discussed in the thread "Question regarding patch for
ProxyCommand setting".

The patch is rather straight forward; maybe it would be a good
idea to improve it in a way that it uses a list of string options
that may have a "none" value to reset it to NULL.


Ciao

Thomas
-------------- next part --------------
Index: readconf.c
===================================================================
RCS file: /cvs/openssh/readconf.c,v
retrieving revision 1.76
diff -u -r1.76 readconf.c
--- readconf.c	9 Jul 2002 14:06:40 -0000	1.76
+++ readconf.c	30 Sep 2002 19:00:22 -0000
@@ -724,6 +724,19 @@
 	if (bad_options > 0)
 		fatal("%s: terminating, %d bad configuration options",
 		    filename, bad_options);
+
+	/*
+	 * If proxy_command is set to 'none' (actually ' none' due to the way
+	 * the code in process_config_line works), unset it. This allows for
+	 * excluding certain hosts from using the proxy command while having it
+	 * enabled by default (i.e. for 'Host *')
+	 */
+	if (options->proxy_command != NULL) {
+		if (strcmp(options->proxy_command, " none") == 0) {
+			xfree(options->proxy_command);
+			options->proxy_command = NULL;
+		}
+	}
 	return 1;
 }
 


More information about the openssh-unix-dev mailing list