From cgull@smoke.marlboro.vt.us  Fri Dec  1 01:11:42 1995
Received: from smoke.marlboro.vt.us (smoke.marlboro.vt.us [198.206.215.91])
          by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id BAA22949
          for <FreeBSD-gnats-submit@freebsd.org>; Fri, 1 Dec 1995 01:11:22 -0800
Received: (from cgull@localhost) by smoke.marlboro.vt.us (8.6.*cough-wheeze*/8.6.9) id EAA04330; Fri, 1 Dec 1995 04:10:12 -0500
Message-Id: <199512010910.EAA04330@smoke.marlboro.vt.us>
Date: Fri, 1 Dec 1995 04:10:12 -0500
From: john hood <cgull@smoke.marlboro.vt.us>
Reply-To: cgull@smoke.marlboro.vt.us
To: FreeBSD-gnats-submit@freebsd.org
Cc: netbsd-bugs@netbsd.org, flla@stud.uni-sb.de
Subject: longstanding ash -c bug [FreeBSD report]
X-Send-Pr-Version: 3.2

>Number:         859
>Category:       bin
>Synopsis:       /bin/sh -c does not ignore SIGINT
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    joerg
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Dec  1 01:20:03 PST 1995
>Closed-Date:    Mon Sep 16 18:58:28 PDT 1996
>Last-Modified:  Mon Sep 16 19:00:44 PDT 1996
>Originator:     john hood
>Release:        FreeBSD 2.0-BUILT-19950603 i386
>Organization:
none
>Environment:

any variant of the Almquist shell I've ever tested, including netbsd
0.9, netbsd 1.0-current-sparc of about six months ago, freebsd
1.1.5.1, freebsd 2.1.5, the antique Linux port of the Almquist shell,
and the way ancient comp.sources.unix distribution by Almquist himself

(yes, i've been extremely lame about this bug)

>Description:

'sh -c command' does not ignore/handle SIGINT while waiting for command
to complete.

>How-To-Repeat:

keyboard SIGINT in emacs or vi while posting in trn, or try
this interactive ditty and see if the subshell keeps on running:

------------------------------8<------------------------------
#!/bin/sh
#
# test sig handling in sh -c
#
# create second script
TF=/tmp/test.$$
cat > $TF <<\/EOF
#!/bin/sh
echo -e "shell c flags: $-"
trap
trap : 2 3
echo "Type ^C and ^\\"
for i in a b c d e
do
  sleep 1
  echo shell c: $i
done
/EOF
chmod a+x $TF

if [ $# != 1 ]
then
  echo "$0 shell-to-test"
  exit 1
fi
SHELL=$1
echo -e "shell a flags: $-"
trap
trap : 2 3
$SHELL -c "echo shell b flags: $-; trap; $TF"
echo 'shell a exit: ' $?
rm $TF
------------------------------8<------------------------------

>Fix:
	
none

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->joerg 
Responsible-Changed-By: joerg 
Responsible-Changed-When: Fri Apr 12 23:36:24 MET DST 1996 
Responsible-Changed-Why:  
I'm goinmg to deal with sh(1) bugs some day. 
State-Changed-From-To: open->closed 
State-Changed-By: alex 
State-Changed-When: Mon Sep 16 18:58:28 PDT 1996 
State-Changed-Why:  
Fixed with the recent integration of Lite2 fixes. 

Thanks to Steve Price <sprice@hiwaay.net> for pointing this out. 
>Unformatted:

