NetBSD/bin/sh
yamt 44f7683783 fix descriptor leaks. PR/47805
this fix was taken from FreeBSD SVN rev 199953 (Jilles Tjoelker)
    ------------------------------------------------------------------------
    r199953 | jilles | 2009-11-30 07:33:59 +0900 (Mon, 30 Nov 2009) | 16 lines

    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.
2013-06-27 23:22:04 +00:00
..
bltin
funcs
USD.doc RCSIds 2010-08-22 02:19:07 +00:00
alias.c PR/45069: Henning Petersen: Use prototypes from builtins.h . 2011-06-18 21:18:46 +00:00
alias.h PR/45069: Henning Petersen: Use prototypes from builtins.h . 2011-06-18 21:18:46 +00:00
arith_lex.l Use C89 function definitions 2012-03-20 18:42:28 +00:00
arith.y Use C89 function definitions 2012-03-20 18:42:28 +00:00
builtins.def Add support for '%n' being a shorthand for 'fg %n'. 2012-12-31 14:10:15 +00:00
cd.c NULL does not need a cast 2011-08-31 16:24:54 +00:00
cd.h PR/45069: Henning Petersen: Use prototypes from builtins.h . 2011-06-18 21:18:46 +00:00
error.c Add __printflike attribution to use vprintf and friends with an argument 2012-03-15 02:02:20 +00:00
error.h Add __printflike attribution to use vprintf and friends with an argument 2012-03-15 02:02:20 +00:00
eval.c fix descriptor leaks. PR/47805 2013-06-27 23:22:04 +00:00
eval.h
exec.c Add support for '%n' being a shorthand for 'fg %n'. 2012-12-31 14:10:15 +00:00
exec.h Add __printflike attribution to use vprintf and friends with an argument 2012-03-15 02:02:20 +00:00
expand.c Fix the expansion of "$(foo-$bar}" so that IFS isn't applied when 2012-12-22 20:15:22 +00:00
expand.h Fix the expansion of "$(foo-$bar}" so that IFS isn't applied when 2012-12-22 20:15:22 +00:00
histedit.c Use C89 function definitions 2012-03-20 18:42:28 +00:00
init.h
input.c include <limits.h> for CHAR_MIN/CHAR_MAX 2012-03-28 20:11:25 +00:00
input.h
jobs.c Add support for '%n' being a shorthand for 'fg %n'. 2012-12-31 14:10:15 +00:00
jobs.h PR/45069: Henning Petersen: Use prototypes from builtins.h . 2011-06-18 21:18:46 +00:00
machdep.h
mail.c
mail.h
main.c PR/45069: Henning Petersen: Use prototypes from builtins.h . 2011-06-18 21:18:46 +00:00
main.h PR/45069: Henning Petersen: Use prototypes from builtins.h . 2011-06-18 21:18:46 +00:00
Makefile Adjust everything under src (but outside src/tools) to use 2012-12-02 12:55:27 +00:00
memalloc.c
memalloc.h
miscbltin.c Allow thread limit queries by adding the new -r flag to ulimit. Add 2012-06-11 18:28:10 +00:00
miscbltin.h
mkbuiltins
mkinit.sh
mknodes.sh
mktokens
myhistedit.h PR/45069: Henning Petersen: Use prototypes from builtins.h . 2011-06-18 21:18:46 +00:00
mystring.c Add const. 2013-04-28 17:01:28 +00:00
mystring.h
nodes.c.pat Use C89 function definitions 2012-03-20 18:42:28 +00:00
nodetypes
options.c Use C89 function definitions 2012-03-20 18:42:28 +00:00
options.h PR/45069: Henning Petersen: Use prototypes from builtins.h . 2011-06-18 21:18:46 +00:00
output.c dprintf is claimed by posix. 2010-08-30 06:27:14 +00:00
output.h Add __printflike attribution to use vprintf and friends with an argument 2012-03-15 02:02:20 +00:00
parser.c Initialize two variables for clang. 2012-06-17 20:48:27 +00:00
parser.h
redir.c fix descriptor leaks. PR/47805 2013-06-27 23:22:04 +00:00
redir.h Tell copyfd if the caller wants the exact tofd to just fd >= tofd. 2011-02-17 15:13:49 +00:00
sh.1 Document that a here-document can finish at an EOF as well as at the 2013-05-09 11:43:27 +00:00
shell.h Add const. 2013-04-28 17:01:28 +00:00
show.c - add pid to the trace file so that we don't keep overwriting ourselves 2011-08-23 10:01:32 +00:00
show.h
syntax.c include <limits.h> for CHAR_MIN/CHAR_MAX 2012-03-28 20:11:25 +00:00
syntax.h
TOUR
trap.c PR/45069: Henning Petersen: Use prototypes from builtins.h . 2011-06-18 21:18:46 +00:00
trap.h Add __printflike attribution to use vprintf and friends with an argument 2012-03-15 02:02:20 +00:00
var.c PR/47317: Henning Petersen: Replace index() with strchr() 2012-12-13 19:33:23 +00:00
var.h PR/45069: Henning Petersen: Use prototypes from builtins.h . 2011-06-18 21:18:46 +00:00