From Philippe.Causse@mobilix.dk  Mon Sep 21 00:30:26 1998
Received: from fw.mobilix.dk ([194.234.180.130])
          by hub.freebsd.org (8.8.8/8.8.8) with SMTP id AAA18721
          for <FreeBSD-gnats-submit@freebsd.org>; Mon, 21 Sep 1998 00:30:20 -0700 (PDT)
          (envelope-from Philippe.Causse@mobilix.dk)
Received: by fw.mobilix.dk; (5.65v4.0/1.3/10May95) id AA10144; Mon, 21 Sep 1998 09:28:59 +0200
Received: by ms07.mobilix.dk with Internet Mail Service (5.5.1960.3)
	id <R050RZZW>; Mon, 21 Sep 1998 09:26:12 +0100
Message-Id: <3B26A8A0A71CD211A18B0008C724C75409B4AB@ms05.mobilix.dk>
Date: Mon, 21 Sep 1998 09:26:01 +0100
From: Philippe Causse <Philippe.Causse@mobilix.dk>
To: "'FreeBSD-gnats-submit@freebsd.org'"
	 <FreeBSD-gnats-submit@freebsd.org>
Subject: rsh does not accept data on input stream

>Number:         8006
>Category:       bin
>Synopsis:       rsh does not accept data on input stream
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Sep 21 00:40:00 PDT 1998
>Closed-Date:    Wed Dec 9 17:23:35 PST 1998
>Last-Modified:  Wed Dec  9 17:24:15 PST 1998
>Originator:     Philippe CAUSSE
>Release:        FreeBSD 2.2.7-RELEASE i386
>Organization:
Mobilix A/S - Denmark.
>Environment:

Standard FreeBSD box, no Kerberos.


>Description:

rsh does not read the standard input.
This prevents from doing transfers over rsh like:
	 tar cf - /dir | rsh host tar xvf -

>How-To-Repeat:

On a 2.2.7-R box, try:  echo foobar | rsh localhost cat
It fails to print foobar, as expected.

>Fix:
	
By running a diff from 2.2.6-RELEASE agains 2.2.7-RELEASE, I easily
found
the bug.  It was a local declaration of variable s in function doit().

Below is a diff for applying the correction.

*** rshd.c.orig	Sat Sep 19 12:28:14 1998
--- rshd.c	Sat Sep 19 12:28:00 1998
***************
*** 304,310 ****
  	(void) alarm(0);
  	if (port != 0) {
  		int lport = IPPORT_RESERVED - 1;
! 		int s = rresvport(&lport);
  		if (s < 0) {
  			syslog(LOG_ERR, "can't get stderr port: %m");
  			exit(1);
--- 304,310 ----
  	(void) alarm(0);
  	if (port != 0) {
  		int lport = IPPORT_RESERVED - 1;
! 		s = rresvport(&lport);
  		if (s < 0) {
  			syslog(LOG_ERR, "can't get stderr port: %m");
  			exit(1);

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: gnats-admin->freebsd-bugs 
Responsible-Changed-By: steve 
Responsible-Changed-When: Sat Oct 3 15:45:53 PDT 1998 
Responsible-Changed-Why:  
Misfiled PR. 

From: tedm@toybox.placo.com
To: freebsd-gnats-submit@freebsd.org, Philippe.Causse@mobilix.dk
Cc:  Subject: Re:bin/8006:rshdoesnotacceptdataoninputstream
Date: Mon, 5 Oct 1998 01:35:31 -0700 (PDT)

 I also noticed this bug for the same reason. (wanted to make network backups)
 Can we put this in errata file?  I enabled rexecd for now and changed the
 jobs around.
 
 It would be even better if the corrected binary could be placed up on
 ftp.cdrom.com, for those that don't have room to install the source tree.
 
State-Changed-From-To: open->closed 
State-Changed-By: steve 
State-Changed-When: Wed Dec 9 17:23:35 PST 1998 
State-Changed-Why:  
This has already been fixed in -current and -stable. 
>Unformatted:
