Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Apr 2001 11:43:47 +0200 (CEST)
From:      adrian@freebsd.org
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/26376: Fix for rsync hanging when using ssh
Message-ID:  <200104060943.f369hlc40738@nympho.cacheboy.net>

next in thread | raw e-mail | index | archive | help

>Number:         26376
>Category:       ports
>Synopsis:       Fix for rsync hanging when using ssh
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr 06 02:50:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Adrian Chadd
>Release:        FreeBSD 4.3-RC i386
>Organization:
>Environment:
System: FreeBSD nympho.cacheboy.net 4.3-RC FreeBSD 4.3-RC #0: Thu Mar 29 19:02:08 CEST 2001 adrian@nympho.cacheboy.net:/usr/obj/usr/src/sys/GENERIC i386


	
>Description:

rsync freezes during execution if it is run over ssh.
If it runs over the tcp rsync protocol everything works ok.
I haven't tested rsh.

When the great s/rsh/ssh/ was done, someone overlooked a bit of
main.c which sets blocking_io if the remote shell command matched
RSYNC_RSH. RSYNC_RSH is either "rsh" or "remsh" depending upon
the target OS (remsh I believe is a HP/UX thing.)

The thing is, ssh doesn't work if blockingio is used. From util.c :

/* this is derived from CVS code
   
   note that in the child STDIN is set to blocking and STDOUT
   is set to non-blocking. This is necessary as rsh relies on stdin being blocki
ng
   and ssh relies on stdout being non-blocking
  
   if blocking_io is set then use blocking io on both fds. That can be
   used to cope with badly broken rsh implementations like the one on
   solaris.
 */

.. if blocking_io is set then ssh breaks since stdout is now blocking.


>How-To-Repeat:

Run rsync over ssh rather than the rsync protocol.
Watch it hang during a large update. :-)

>Fix:

Apply the following patch to the port to make this rsh check map to
rsh (I forced it here since under FreeBSD we shouldn't have remsh :-)
and everything works happily again.


Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/net/rsync/Makefile,v
retrieving revision 1.55
diff -u -r1.55 Makefile
--- Makefile	2001/03/08 11:40:19	1.55
+++ Makefile	2001/04/06 09:38:20
@@ -8,7 +8,7 @@
 
 PORTNAME=	rsync
 PORTVERSION=	2.4.6
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	net ipv6
 MASTER_SITES=	ftp://samba.anu.edu.au/pub/rsync/  \
 		ftp://sunsite.auc.dk/pub/unix/rsync/  \
Index: files/patch-aa
===================================================================
RCS file: patch-aa
diff -N patch-aa
--- /dev/null	Fri Apr  6 11:00:04 2001
+++ patch-aa	Fri Apr  6 11:38:20 2001
@@ -0,0 +1,11 @@
+--- main.c.orig	Fri Apr  6 08:41:23 2001
++++ main.c	Fri Apr  6 08:41:25 2001
+@@ -160,7 +160,7 @@
+ 		server_options(args,&argc);
+ 
+ 
+-		if (strcmp(cmd, RSYNC_RSH) == 0) blocking_io = 1;
++		if (strcmp(cmd, "rsh") == 0) blocking_io = 1;
+ 	}
+ 
+ 	args[argc++] = ".";
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200104060943.f369hlc40738>