- Made -V the short option for --version.
+ - Forward -4 & -6 options to the ssh command, making them easier to type than
+ "--rsh='ssh -4'" (or -6).
+
### PACKAGING RELATED:
- Add installed binary: /usr/bin/rsync-sll
extern BOOL shutting_down;
extern int backup_dir_len;
extern int basis_dir_cnt;
+extern int default_af_hint;
extern struct stats stats;
extern char *stdout_format;
extern char *logfile_format;
*t++ = '\0';
}
- /* check to see if we've already been given '-l user' in
- * the remote-shell command */
+ /* NOTE: must preserve t == start of command name until the end of the args handling! */
+ if ((t = strrchr(cmd, '/')) != NULL)
+ t++;
+ else
+ t = cmd;
+
+ /* Check to see if we've already been given '-l user' in the remote-shell command. */
for (i = 0; i < argc-1; i++) {
if (!strcmp(args[i], "-l") && args[i+1][0] != '-')
dash_l_set = 1;
args[argc++] = "-l";
args[argc++] = user;
}
+#ifdef AF_INET
+ if (default_af_hint == AF_INET && strcmp(t, "ssh") == 0)
+ args[argc++] = "-4"; /* we're using ssh so we can add a -4 option */
+#endif
+#ifdef AF_INET6
+ if (default_af_hint == AF_INET6 && strcmp(t, "ssh") == 0)
+ args[argc++] = "-6"; /* we're using ssh so we can add a -6 option */
+#endif
args[argc++] = machine;
#endif
args[argc++] = rsync_path;
- if (blocking_io < 0) {
- char *cp;
- if ((cp = strrchr(cmd, '/')) != NULL)
- cp++;
- else
- cp = cmd;
- if (strcmp(cp, "rsh") == 0 || strcmp(cp, "remsh") == 0)
- blocking_io = 1;
- }
+ if (blocking_io < 0 && (strcmp(t, "rsh") == 0 || strcmp(t, "remsh") == 0))
+ blocking_io = 1;
- server_options(args,&argc);
+ server_options(args, &argc);
if (argc >= MAX_ARGS - 2)
goto arg_overflow;
0. `--ipv4`, `-4` or `--ipv6`, `-6`
- Tells rsync to prefer IPv4/IPv6 when creating sockets. This only affects
- sockets that rsync has direct control over, such as the outgoing socket
- when directly contacting an rsync daemon. See also these options in the
- `--daemon` mode section.
+ Tells rsync to prefer IPv4/IPv6 when creating sockets or running ssh. This
+ affects sockets that rsync has direct control over, such as the outgoing
+ socket when directly contacting an rsync daemon, as well as the forwaring
+ of the `-4` or `-6` option to ssh when rsync can deduce that ssh is being
+ used as the remote shell. For other remote shells you'll need to specify
+ the "`--rsh SHELL -4`" option directly (or whatever ipv4/ipv6 hint options
+ it uses).
+
+ These options also exist in the `--daemon` mode section.
If rsync was complied without support for IPv6, the `--ipv6` option will
- have no effect. The `--version` output will tell you if this is the case.
+ have no effect. The `rsync -V` output will contain "no IPv6" if is the
+ case.
+
+ See also these options in the `--daemon` mode section.
0. `--checksum-seed=NUM`
using the port, try specifying `--ipv6` or `--ipv4` when starting the
daemon).
+ These options also exist in the regular rsync options section.
+
If rsync was complied without support for IPv6, the `--ipv6` option will
- have no effect. The `--version` output will tell you if this is the case.
+ have no effect. The `rsync -V` output will contain "no IPv6" if is the
+ case.
0. `--help`, `-h`