Bug 26376 - Fix for rsync hanging when using ssh
Summary: Fix for rsync hanging when using ssh
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: David E. O'Brien
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-04-06 10:50 UTC by Adrian Chadd
Modified: 2001-04-08 16:49 UTC (History)
0 users

See Also:


Attachments
file.diff (950 bytes, patch)
2001-04-06 10:50 UTC, Adrian Chadd
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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!!