NetBSD/bin
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
..
cat only allocate if it would not fit in our buffer. 2012-11-19 19:41:31 +00:00
chio Use Lk. 2012-03-17 11:09:29 +00:00
chmod fix argument parsing. 2012-10-22 18:00:46 +00:00
cp From patch by Bug Hunting: 2012-03-25 22:37:08 +00:00
csh Make shifting variables reflect their environment counterparts. Makes 2013-04-03 17:32:24 +00:00
date - fix timed(8) references; 2012-04-06 11:36:56 +00:00
dd let the standard rules deal with librumpclient 2012-08-08 14:09:14 +00:00
df use strspct. 2012-01-07 18:45:13 +00:00
domainname Use __dead 2011-08-29 14:51:17 +00:00
echo Check ferror(stdout) and exit(1) if there's been a problem. 2008-09-18 05:42:08 +00:00
ed Use __dead 2011-08-29 14:51:17 +00:00
expr Improvements: wording, punctuation, macro usage. 2012-08-12 17:27:04 +00:00
hostname Use __dead 2011-08-29 14:51:17 +00:00
kill Fix whitespace nits. Suggested by Bug Hunting. 2012-03-22 07:58:16 +00:00
ksh support RLIMIT_NTHR 2012-06-09 02:50:43 +00:00
ln Fix whitespace nits. Suggested by Bug Hunting. 2012-03-22 07:58:16 +00:00
ls remove whitespace from end of file. 2013-05-02 22:43:55 +00:00
mkdir Fix whitespace nits. Suggested by Bug Hunting. 2012-03-22 07:58:16 +00:00
mt Adjust for mandoc output. 2012-03-19 10:48:20 +00:00
mv Fix whitespace nits. Suggested by Bug Hunting. 2012-03-22 07:58:16 +00:00
pax Recognize extended attribute headers and warn about them since we are not 2013-01-24 17:43:44 +00:00
ps Switch device database to cdb(5). Rework ttyname(3) and ttyname_r(3) to 2012-06-03 21:42:44 +00:00
pwd Use __dead 2011-08-29 14:51:17 +00:00
rcmd Sort options in SYNOPSIS, sort option descriptions, remove some extra 2011-05-31 11:31:10 +00:00
rcp allocate a separate buffer in each call to sink(). 2012-05-07 15:22:54 +00:00
rm Sort sections. 2013-04-26 19:34:34 +00:00
rmdir static + __dead 2011-08-29 14:47:47 +00:00
sh fix descriptor leaks. PR/47805 2013-06-27 23:22:04 +00:00
sleep Use __dead 2011-08-29 14:51:17 +00:00
stty Remove another Pf. From Bug Hunting. 2012-06-20 14:19:39 +00:00
sync Remove the \n and tabs from the __COPYRIGHT() strings. 2008-07-20 00:52:39 +00:00
test test(1): Compare timestamp in nsec scale in -nt/-ot. 2013-05-04 06:26:44 +00:00
Makefile Remove systrace. Ok core@. 2007-12-31 15:31:24 +00:00
Makefile.inc Default to WARNS=5 2012-03-21 05:47:53 +00:00