Bug 26376

Summary: Fix for rsync hanging when using ssh
Product: Ports & Packages Reporter: Adrian Chadd <adrian>
Component: Individual Port(s)Assignee: David E. O'Brien <obrien>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Adrian Chadd freebsd_committer freebsd_triage 2001-04-06 10:50:00 UTC
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.

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.

How-To-Repeat: 
Run rsync over ssh rather than the rsync protocol.
Watch it hang during a large update. :-)
Comment 1 Adrian Chadd freebsd_committer freebsd_triage 2001-04-06 10:51:40 UTC
Responsible Changed
From-To: freebsd-ports->obrien

Over to maintainer
Comment 2 David E. O'Brien freebsd_committer freebsd_triage 2001-04-08 16:48:56 UTC
State Changed
From-To: open->closed

simular fix committed. 
THANKS!!