HardenedBSD/bin
Jilles Tjoelker 960da93430 Avoid leaving unnecessary waiting shells in many forms of sh -c COMMAND.
This change only affects strings passed to -c, when the -s
option is not used.

The approach is to check if there may be additional data
in the string after parsing each command. If there is none,
use the EV_EXIT flag so that a fork may be omitted in
specific cases.

If there are empty lines after the command, the check will
not see the end and forks will not be omitted. The same
thing seems to happen in bash.

Example:
  sh -c 'ps lT'
No longer shows a shell process waiting for ps to finish.

PR:		bin/113860
Reviewed by:	stefanf
Approved by:	ed (mentor)
2009-06-13 21:17:45 +00:00
..
cat
chflags
chio
chmod
cp
csh
date
dd
df
domainname
echo
ed
expr
getfacl
hostname
kenv
kill
ln
ls
mkdir
mv
pax
pkill
ps
pwd
rcp
realpath
rm
rmail
rmdir
setfacl
sh
sleep
stty
sync
test
uuidgen
Makefile
Makefile.inc