🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.bugs.sys5
Article #417

Re: SVR4 /bin/sh BUG

#417
From: Malcolm Mladenovic
Date: Sat, 01 Jun 1991 13:35
43 lines
1956 bytes
In article <20798@uudell.dell.com> jrh@mustang.dell.com (Randy Howard) writes:
>In article <1991May30.171404.23422@cbnewsl.att.com>, urban@cbnewsl.att.com (john.urban) writes:
>|> In article <1991May30.034223.29061@digibd.com> rick@digibd.com (Rick Richardson) writes:
>|> >Known to fail on AT&T, HCI, Commodore, and i860 SVR4's.
>|> Your program DOES NOT FAIL on AT&T UNIX System V/386 Release 4.0 Version 2.1.
>|> I verified that it works fine with the ksh and the sh.

It will work with ksh - see below.

>
>Well, that may be true, but the AT&T Release 4.0 Version 3.0 'reference port' 
>or 'Test Engine' as it is sometimes called definitely DOES FAIL.  It is 
>somewhat interesting that if you run it under ksh with: 'truss shbug' it will
>also fail at the same point it does in sh.

This bug is caused by the same problem that was mentioned some time ago
in this group, namely redirection on 'exec' and ':' builtins do not work
correctly.

For ksh, only the second form fails, eg

#!/bin/ksh
for i in a b c d e f g h
do
	: >$i
done

only creates file 'a'.

The exec variety fails on sh in rather more obscure ways.

Neither of these shells is fixed on the 'Version 3.0' 386 tape, from
a quick look at the code. I have built the sh source and it fails
the test as reported by Randy above.

The reason a 'truss shbug' run from ksh fails is that truss uses execvp
(and hence sh) to invoke the program.

-Malcolm

-- 
Malcolm Mladenovic				mbm@dsbc.icl.co.uk
standard disclaimer applies
Technical Details
Message-ID: <42@dsbc.icl.co.uk>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!mcsun!ukc!stl!dsbc!mbm
References: <1991May30.034223.29061@digibd.com> <1991May30.171404.23422@cbnewsl.att.com> <20798@uudell.dell.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!mcsun!ukc!stl!dsbc!mbm
From: mbm@dsbc.icl.co.uk (Malcolm Mladenovic)
Newsgroups: comp.bugs.sys5
Subject: Re: SVR4 /bin/sh BUG
Message-ID: <42@dsbc.icl.co.uk>
Date: 1 Jun 91 13:35:16 GMT
References: <1991May30.034223.29061@digibd.com> <1991May30.171404.23422@cbnewsl.att.com> <20798@uudell.dell.com>
Organization: ICL Bracknell, UK
Lines: 43