Paul Slootman
2008-Mar-04 18:07 UTC
when rsync is called with -4 or -6, pass that on to ssh [PATCH]
If rsync is called with -4 or -6, that option is currently ignored when ssh is used as the transport. The attached patch is a stab at passing the option on to the ssh process. It checks that the remote shell program is something that looks like ssh. Perhaps that could be done cleaner... Paul Slootman --- a/main.c 2008-03-01 21:01:41.000000000 +0100 +++ b/main.c 2008-03-04 18:55:10.933488013 +0100 @@ -82,6 +82,7 @@ #ifdef ICONV_OPTION extern iconv_t ic_send; #endif +extern int default_af_hint; uid_t our_uid; int local_server = 0; @@ -381,6 +382,23 @@ *t++ = '\0'; } +#ifdef AF_INET + if (default_af_hint == AF_INET) { + if (strncmp(cmd, "ssh", 3) == 0 || strstr(cmd, "/ssh") != NULL) { + /* we're using ssh so we can add a -4 option */ + args[argc++] = "-4"; + } + } +#endif +#ifdef AF_INET6 + if (default_af_hint == AF_INET6) { + if (strncmp(cmd, "ssh", 3) == 0 || strstr(cmd, "/ssh") != NULL) { + /* we're using ssh so we can add a -6 option */ + args[argc++] = "-6"; + } + } +#endif + /* check to see if we've already been given '-l user' in * the remote-shell command */ for (i = 0; i < argc-1; i++) {
Wayne Davison
2008-Mar-05 01:29 UTC
when rsync is called with -4 or -6, pass that on to ssh [PATCH]
On Tue, Mar 04, 2008 at 07:07:07PM +0100, Paul Slootman wrote:> If rsync is called with -4 or -6, that option is currently ignored when > ssh is used as the transport.That's because those options are only used when opening a socket. The user should configure ssh on their own. I'd suggest that they use the ~/.ssh/config file to set such options for particular hosts and/or all hosts. I may add some code to ssh to warn and continue if -4 or -6 is used with an external shell transport (to let the user know that it is meaningless). ..wayne..
Apparently Analagous Threads
- DO NOT REPLY [Bug 5075] New: Syncing with --iconv may yield protocol error
- C coding tips please / Localisation
- [PATCH] build fix without iconv support
- [patch] Replace illegal characters in filenames for FAT (switch)
- [Bug 1924] New: unable to rsync between a PC with cygwin and a unix machine using rsh