freebsd-dev/tools/regression/bin/sh/execution
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
..
fork1.0
fork2.0
func1.0 sh: Fix crash when undefining or redefining a currently executing function. 2009-08-23 21:09:46 +00:00
func2.0 sh: Fix crash with empty functions (f() { }) introduced in r196483 2009-08-28 22:41:25 +00:00
redir1.0 Fix some cases where file descriptors from redirections leak to programs. 2009-11-29 22:33:59 +00:00
redir2.0 Fix some cases where file descriptors from redirections leak to programs. 2009-11-29 22:33:59 +00:00
unknown1.0 sh: Send the "xyz: not found" message to redirected fd 2. 2009-10-06 22:00:14 +00:00