Improved the default-blocking-I/O code to discern rsh from ssh
authorWayne Davison <wayned@samba.org>
Tue, 16 Dec 2003 18:02:03 +0000 (18:02 +0000)
committerWayne Davison <wayned@samba.org>
Tue, 16 Dec 2003 18:02:03 +0000 (18:02 +0000)
properly.

main.c

diff --git a/main.c b/main.c
index dca8399..f1c2d09 100644 (file)
--- a/main.c
+++ b/main.c
@@ -241,8 +241,15 @@ static pid_t do_cmd(char *cmd,char *machine,char *user,char *path,int *f_in,int
 
                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);