freebsd-skq/bin/sh
Jilles Tjoelker e1ef314121 Fix some cases where file descriptors from redirections leak to programs.
- Redirecting fds that were not open before kept two copies of the
  redirected file.
    sh -c '{ :; } 7>/dev/null; fstat -p $$; true'
    (both fd 7 and 10 remained open)
- File descriptors used to restore things after redirection were not
  set close-on-exec, instead they were explicitly closed before executing
  a program normally and before executing a shell procedure. The latter
  must remain but the former is replaced by close-on-exec.
    sh -c 'exec 7</; { exec fstat -p $$; } 7>/dev/null; true'
    (fd 10 remained open)

The examples above are simpler than the testsuite because I do not want to
use fstat or procstat in the testsuite.
2009-11-29 22:33:59 +00:00
..
bltin
funcs
alias.c
alias.h
arith_lex.l sh: Fix memory leak when using a variable in arithmetic like $((x)). 2009-11-05 20:44:39 +00:00
arith.h
arith.y
builtins.def
cd.c Handle current work directories of arbitrary length. The argument to cd 2009-11-21 14:53:22 +00:00
cd.h
error.c Fix various things about SIGINT handling: 2009-11-22 18:23:30 +00:00
error.h Fix various things about SIGINT handling: 2009-11-22 18:23:30 +00:00
eval.c Fix some cases where file descriptors from redirections leak to programs. 2009-11-29 22:33:59 +00:00
eval.h Avoid leaving unnecessary waiting shells in many forms of sh -c COMMAND. 2009-06-13 21:17:45 +00:00
exec.c sh: Send the "xyz: not found" message to redirected fd 2. 2009-10-06 22:00:14 +00:00
exec.h sh: Fix crash when undefining or redefining a currently executing function. 2009-08-23 21:09:46 +00:00
expand.c sh: Exempt $@ and $* from set -u 2009-10-24 21:20:04 +00:00
expand.h
histedit.c sh: Some changes to stderr flushing: 2009-11-21 14:28:32 +00:00
init.h
input.c sh: Ensure the same command input file is on top after executing a builtin. 2009-11-22 14:04:20 +00:00
input.h sh: Ensure the same command input file is on top after executing a builtin. 2009-11-22 14:04:20 +00:00
jobs.c sh: Some changes to stderr flushing: 2009-11-21 14:28:32 +00:00
jobs.h
mail.c
mail.h
main.c sh: Some changes to stderr flushing: 2009-11-21 14:28:32 +00:00
main.h
Makefile
memalloc.c
memalloc.h
miscbltin.c Usermode portion of the support for swap allocation accounting: 2009-06-23 20:57:27 +00:00
mkbuiltins
mkinit.c
mknodes.c sh: Fix crash with empty functions (f() { }) introduced in r196483 2009-08-28 22:41:25 +00:00
mksyntax.c
mktokens
myhistedit.h
mystring.c
mystring.h
nodes.c.pat sh: Fix crash with empty functions (f() { }) introduced in r196483 2009-08-28 22:41:25 +00:00
nodetypes
options.c
options.h
output.c sh: Some changes to stderr flushing: 2009-11-21 14:28:32 +00:00
output.h sh: Some changes to stderr flushing: 2009-11-21 14:28:32 +00:00
parser.c Fix various things about SIGINT handling: 2009-11-22 18:23:30 +00:00
parser.h
redir.c Fix some cases where file descriptors from redirections leak to programs. 2009-11-29 22:33:59 +00:00
redir.h
sh.1 sh: Exempt $@ and $* from set -u 2009-10-24 21:20:04 +00:00
shell.h
show.c
show.h
TOUR
trap.c trap: do not consider a bad signal name a fatal error. 2009-11-21 20:44:34 +00:00
trap.h
var.c Fix various things about SIGINT handling: 2009-11-22 18:23:30 +00:00
var.h