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; }
On Mon, 30 Sep 2002, Thomas Binder wrote:> 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. >Ugh..I was expecting something closer to where all the argument processing happens. Like below (don't 'whinge' I have not even compiled it. Just an example). - Ben Index: readconf.c ==================================================================RCS file: /cvs/src/usr.bin/ssh/readconf.c,v retrieving revision 1.100 diff -u -r1.100 readconf.c --- readconf.c 19 Jun 2002 00:27:55 -0000 1.100 +++ readconf.c 30 Sep 2002 19:38:09 -0000 @@ -491,7 +491,11 @@ strcat(string, arg); } if (*activep && *charptr == NULL) - *charptr = string; + if (strcmp(arg, "none") == 0) { + *charptr == NULL + xfree(string); + } else + *charptr = string; else xfree(string); return 0;
binder> As discussed in the thread "Question regarding patch for binder> ProxyCommand setting". binder> binder> The patch is rather straight forward; maybe it would be a good binder> idea to improve it in a way that it uses a list of string options binder> that may have a "none" value to reset it to NULL. I think it's against the syntax of OpenSSH configuration. In readconf.c # Any configuration value is only changed the first time it is set. # Thus, host-specific definitions should be at the beginning of the # configuration file, and defaults at the end. Thus, the order of 'none' must specified earlier and you can't reset it to NULL at this timing. Host foo ProxyCommand none Host * ProxyCommand /some/command -- MARUYAMA Shinichi <marya at st.jip.co.jp>