default --rsh

Wayne Davison wayned at samba.org
Tue Dec 16 15:29:36 EST 2003


On Mon, Dec 15, 2003 at 12:11:41PM -0800, jw schultz wrote:
> It would be worthwhile to add a note in INSTALL to advise people of
> the --with-rsh configure option.

I would not currently recommend that people use --with-rsh to set the
default to be ssh because that affects the blocking I/O default in a
weird way (i.e. it makes ssh default to blocking I/O and an override of
rsh default to non-blocking I/O, which is backwards from what is
desired).

> Any thoughts, particularly with regard to putting this in before
> 2.6.0?

I've attached one possible patch that does the following:

 - Changed configure.in to set RSYNC_RSH to "ssh" by default (be sure to
   run "autoconf" if you try this patch).

 - Changed main.c to make blocking_io be the default if the remote shell
   command is either rsh or remsh (instead of comparing with RSYNC_RSH).

We should then add a prominent release note that says that any site that
still desires a default of rsh (or remsh) should add "--with-rsh=rsh"
(or "--with-rsh=remsh") to their ./configure command.

I'm feeling a little more comfortable with this change now.  What do
folks think about having something like this in 2.6.0?

..wayne..
-------------- next part --------------
--- configure.in	15 Dec 2003 19:00:20 -0000	1.173
+++ configure.in	16 Dec 2003 04:24:31 -0000
@@ -90,14 +90,14 @@
         [  --with-included-popt    use bundled popt library, not from system])
 
 AC_ARG_WITH(rsync-path,
-	[  --with-rsync-path=PATH  set default --rsync-path to PATH (default: \"rsync\")],
+	[  --with-rsync-path=PATH  set default --rsync-path to PATH (default: rsync)],
 	[ RSYNC_PATH="$with_rsync_path" ],
 	[ RSYNC_PATH="rsync" ])
 
 AC_DEFINE_UNQUOTED(RSYNC_PATH, "$RSYNC_PATH", [location of rsync on remote machine])
 
 AC_ARG_WITH(rsh,
-	AC_HELP_STRING([--with-rsh=CMD], [set rsh command to CMD (default: \"remsh\" or \"rsh\")]))
+	AC_HELP_STRING([--with-rsh=CMD], [set remote shell command to CMD (default: ssh)]))
 
 AC_CHECK_PROG(HAVE_REMSH, remsh, 1, 0)
 AC_DEFINE_UNQUOTED(HAVE_REMSH, $HAVE_REMSH, [remote shell is remsh not rsh])
@@ -105,11 +105,8 @@
 if test x"$with_rsh" != x
 then
 	RSYNC_RSH="$with_rsh"
-elif test x"$HAVE_REMSH" = x1
-then 
-	RSYNC_RSH="remsh"
 else
-	RSYNC_RSH="rsh"
+	RSYNC_RSH="ssh"
 fi
 
 AC_DEFINE_UNQUOTED(RSYNC_RSH, "$RSYNC_RSH", [default -e command])
--- main.c	11 Sep 2003 04:53:05 -0000	1.172
+++ main.c	16 Dec 2003 04:24:31 -0000
@@ -241,8 +241,15 @@
 
 		args[argc++] = rsync_path;
 
-		if ((blocking_io == -1) && (strcmp(cmd, RSYNC_RSH) == 0))
-			blocking_io = 1;
+		if (blocking_io == -1) {
+			char *cp = strrchr(cmd, '/');
+			if (cp)
+				cp++;
+			else
+				cp = cmd;
+			if (strcmp(cp, "rsh") == 0 || strcmp(cp, "remsh") == 0)
+				blocking_io = 1;
+		}
 
 		server_options(args,&argc);
 
--- rsync.h	15 Dec 2003 08:07:38 -0000	1.157
+++ rsync.h	16 Dec 2003 04:24:31 -0000
@@ -107,9 +107,7 @@
 
 #include "config.h"
 
-/* The default RSYNC_RSH is always set in config.h, either to "remsh",
- * "rsh", or otherwise something specified by the user.  HAVE_REMSH
- * controls parameter munging for HP/UX, etc. */
+/* The default RSYNC_RSH is always set in config.h. */
 
 #include <sys/types.h>
 


More information about the rsync mailing list