Article View: net.bugs.v7
Article #126Bug in V7 mail (binmail) concerning uux and Bourne shell (?!?)
From: sater
Date: Mon, 30 May 1983 20:07
Date: Mon, 30 May 1983 20:07
34 lines
1643 bytes
1643 bytes
I just found and corrected a bug in V7 mail (binmail).
I also sent this to net.bugs.uucp because it might also occur in
other distributions ([1-9]bsd).
Somewhere in mail.c is code that looks as follows:
while (wait()!=pid) {
if (wait()==-1)
return(0);
}
return(.....);
Whoever wrote or patched this code last must havr forgotten that
wait() is a function with side-effects, to put it mildly.
Change it to:
while ((ret=wait())!=pid) {
if (ret==-1)
return(0);
}
return(.....);
or else the following scenario will happen to you.
$ ls | grep pattern | mail system!name
is started with the Bourne shell. The ls and grep will be children of
mail by the way in which the Bourne shell starts it's pipelines.
The first wait gets the dead body of ls,
the second wait inside the loop gets mail's own child,
the third wait in the while gets grep,
and the fourth fails because all children are gone.
Zero is returned,
mail saved in dead.letter
while actually everything worked.
By the way is there a way in some version of U*x to give a list of children
to wait(), so that you are not bothered by children someone else made?
Hans van Staveren
Vrije Universiteit
Amsterdam Holland
Technical Details
Message-ID:
<195@vu44.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!linus!philabs!mcvax!vu44!saterShow Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!linus!philabs!mcvax!vu44!sater From: sater@vu44.UUCP Newsgroups: net.bugs.v7,net.bugs.uucp Subject: Bug in V7 mail (binmail) concerning uux and Bourne shell (?!?) Message-ID: <195@vu44.UUCP> Date: Mon, 30-May-83 16:07:59 EDT Article-I.D.: vu44.195 Posted: Mon May 30 16:07:59 1983 Date-Received: Tue, 5-Jul-83 19:42:59 EDT Lines: 34