configure --with-rsh=CMD and default blocking-IO support
Wayne Davison
wayned at users.sourceforge.net
Thu Jan 31 06:11:50 EST 2002
A while back I argued for adding a --with-rsh=CMD option to configure
and got some general agreement that it would be a good thing (especially
for systems that don't have rsh at all). However, the changes were
never integrated into rsync.
This patch adds the --with-rsh=CMD option to configure and modifies
main.c to improve the blocking-IO setting code. The old code would set
blocking_io to '1' if the string matched either "rsh" or "remsh"
(whichever one was configured into rsync). The new code has a slightly
modified version of this check (that still works even if RSYNC_RSH isn't
defined to be "rsh"), but it also adds a way to force the blocking-IO
setting (both at configure time and via the RSYNC_RSH environment
variable). The idiom I chose to use was to prefix the value with '@' to
indicate that blocking-IO should be used, and to prefix it with "@@" to
indicate that blocking-IO should not be used. This allows the installer
to specify --with-rsh=@@ssh to explicitly specify non-blocking-IO for
ssh (for the paranoid), the user to specify RSYNC_RSH=@/local/bin/rsh to
get blocking-IO when using a path to rsh (which the old code would force
the user to specify the --blocking-io option), and also to be able to
specify --with-rsh=@@rsh to get a non-blocking-IO rsh by default (which
is impossible with the old code without specifying a path).
I've appended the patch to the end. Don't forget to run autoconf after
applying it.
..wayne..
---8<------8<------8<------8<---cut here--->8------>8------>8------>8---
Index: rsync/config.h.in
--- rsync/config.h.in 15 Jan 2002 09:53:29 -0000 1.68
+++ rsync/config.h.in 30 Jan 2002 18:45:18 -0000
@@ -303,6 +303,9 @@
#undef RETSIGTYPE
/* */
+#undef RSYNC_RSH
+
+/* */
#undef RSYNC_PATH
/* rsync release version */
Index: rsync/configure.in
--- rsync/configure.in 25 Jan 2002 23:19:21 -0000 1.130
+++ rsync/configure.in 30 Jan 2002 18:45:19 -0000
@@ -78,6 +78,10 @@
AC_ARG_WITH(included-popt,
[ --with-included-popt use bundled popt library, not from system])
+AC_ARG_WITH(rsh,
+ [ --with-rsh=CMD set rsh command to CMD (default: \"remsh\" or \"rsh\")],
+ [ AC_DEFINE_UNQUOTED(RSYNC_RSH, "$with_rsh", [ ]) ])
+
AC_ARG_WITH(rsync-path,
[ --with-rsync-path=PATH set default --rsync-path to PATH (default: \"rsync\")],
[ RSYNC_PATH="$with_rsync_path" ],
Index: rsync/main.c
--- rsync/main.c 25 Jan 2002 10:07:41 -0000 1.138
+++ rsync/main.c 30 Jan 2002 18:45:22 -0000
@@ -209,8 +209,19 @@
server_options(args,&argc);
-
- if (strcmp(cmd, RSYNC_RSH) == 0) blocking_io = 1;
+ if (*cmd == '@') {
+ if (*++cmd == '@') {
+ cmd++;
+ blocking_io = 0;
+ } else
+ blocking_io = 1;
+ args[0] = cmd;
+ } else if (strcmp(cmd, "rsh") == 0
+#if HAVE_REMSH
+ || strcmp(cmd, "remsh") == 0
+#endif
+ )
+ blocking_io = 1;
}
args[argc++] = ".";
Index: rsync/rsync.h
--- rsync/rsync.h 25 Jan 2002 23:00:21 -0000 1.121
+++ rsync/rsync.h 30 Jan 2002 18:45:29 -0000
@@ -85,10 +85,12 @@
#include "config.h"
+#ifndef RSYNC_RSH
#if HAVE_REMSH
#define RSYNC_RSH "remsh"
#else
#define RSYNC_RSH "rsh"
+#endif
#endif
#include <sys/types.h>
---8<------8<------8<------8<---cut here--->8------>8------>8------>8---
More information about the rsync
mailing list