From pst@Shockwave.COM  Thu Aug  1 01:17:37 1996
Received: from precipice.shockwave.com (ppp-5-41.rdcy01.pacbell.net [206.170.5.41])
          by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id BAA03565
          for <FreeBSD-gnats-submit@freebsd.org>; Thu, 1 Aug 1996 01:17:36 -0700 (PDT)
Received: (from pst@localhost) by precipice.shockwave.com (8.7.5/8.7.3) id BAA12194; Thu, 1 Aug 1996 01:17:04 -0700 (PDT)
Message-Id: <199608010817.BAA12194@precipice.shockwave.com>
Date: Thu, 1 Aug 1996 01:17:04 -0700 (PDT)
From: Paul Traina <pst@Shockwave.COM>
Reply-To: pst@Shockwave.COM
To: FreeBSD-gnats-submit@freebsd.org
Subject: /bin/sh bug handling <<[n] FD processing
X-Send-Pr-Version: 3.2

>Number:         1454
>Category:       bin
>Synopsis:       /bin/sh bug handling <<[n] FD processing
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    steve
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Aug  1 01:20:02 PDT 1996
>Closed-Date:    Tue Apr 14 12:39:21 PDT 1998
>Last-Modified:  Tue Apr 14 12:39:29 PDT 1998
>Originator:     Paul Traina
>Release:        FreeBSD 2.2-CURRENT i386
>Organization:
Shockwave Engineering
>Environment:

Recent 2.2 current circa July 15th source code.

>Description:

The manual page for sh states that invoking a program with:

	program 2<<EOT
	some stuff
	EOT

should send the text down file descriptor #2 on the program.  It does not.

>How-To-Repeat:

#!/bin/sh
PGPPASSFD=2 pgp +batch=on -ft 2<<EOT
mysecretpassword
EOT

does not work

but

#!/bin/bash
PGPPASSFD=2 pgp +batch=on -ft 2<<EOT
mysecretpassword
EOT

does.

>Fix:
>Release-Note:
>Audit-Trail:

From: J Wunsch <j@uriah.heep.sax.de>
To: pst@Shockwave.COM
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: bin/1454: /bin/sh bug handling <<[n] FD processing
Date: Thu, 1 Aug 1996 18:51:33 +0200 (MET DST)

 As Paul Traina wrote:
 
 > The manual page for sh states that invoking a program with:
 > 
 > 	program 2<<EOT
 > 	some stuff
 > 	EOT
 > 
 > should send the text down file descriptor #2 on the program.  It does not.
 
 $ cat > foo.c
 #include <unistd.h>
 
 int
 main(void)
 {
   char b[512];
   int s;
   while((s = read(2, b, 512)) > 0)
     write(1, b, s);
   return 0;
 }
 ^D
 $ cc foo.c
 $ ./a.out 2<<EOF
 > hello
 > world
 > EOF
 hello
 world
 $
 
 So hmmmm?
 
 -- 
 cheers, J"org
 
 joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
 Never trust an operating system you don't have sources for. ;-)
Responsible-Changed-From-To: freebsd-bugs->joerg 
Responsible-Changed-By: alex 
Responsible-Changed-When: Sat Aug 10 10:22:47 PDT 1996 
Responsible-Changed-Why:  
Joerg is handling /bin/sh bugs. 
State-Changed-From-To: open->feedback 
State-Changed-By: alex 
State-Changed-When: Sat Aug 10 10:25:18 PDT 1996 
State-Changed-Why:  
Feedback has been requested by Joerg.  (Sorry everyone, I forgot to change 
the state when I changed the responsible field.) 
Responsible-Changed-From-To: joerg->steve 
Responsible-Changed-By: steve 
Responsible-Changed-When: Tue Oct 15 19:13:01 PDT 1996 
Responsible-Changed-Why:  
I am working on this one. 
State-Changed-From-To: feedback->closed 
State-Changed-By: phk 
State-Changed-When: Tue Apr 14 12:39:21 PDT 1998 
State-Changed-Why:  
timed out 
>Unformatted:
