From owner-freebsd-ports Fri Apr 6 2:50: 8 2001 Delivered-To: freebsd-ports@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 314C837B443 for ; Fri, 6 Apr 2001 02:50:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f369o1622989; Fri, 6 Apr 2001 02:50:01 -0700 (PDT) (envelope-from gnats) Received: from nympho.cacheboy.net (nympho.cacheboy.net [203.56.168.42]) by hub.freebsd.org (Postfix) with ESMTP id ACD0337B449 for ; Fri, 6 Apr 2001 02:43:58 -0700 (PDT) (envelope-from adrian@nympho.cacheboy.net) Received: (from root@localhost) by nympho.cacheboy.net (8.11.3/8.9.3) id f369hlc40738; Fri, 6 Apr 2001 11:43:47 +0200 (CEST) (envelope-from adrian) Message-Id: <200104060943.f369hlc40738@nympho.cacheboy.net> Date: Fri, 6 Apr 2001 11:43:47 +0200 (CEST) From: adrian@freebsd.org Reply-To: adrian@freebsd.org To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: ports/26376: Fix for rsync hanging when using ssh Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >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