MirBSD Korn Shell for Jehanne
Go to file
tg d415592b37 check return value of unlink(2) when trying to remove an existing HISTFILE,
since mksh(1) did go into an infinite loop if that fails first

bug spotted, initial patch and help drafting a test case
From: Decklin Foster <decklin@red-bean.com>

note there are more instances of unlink(2) and others (like chmod(2), as
spotted by flawfinder) which aren’t checked… but at least the other case
of unlink(2) use in histrap.c doesn’t cause any trouble (I think)
2008-07-06 22:41:09 +00:00
alloc.c quieten gcc __CRAZY (-m32) on sparc64 2007-06-05 18:59:54 +00:00
Build.sh support arc4random.c in build but not src dir, too 2008-06-29 19:46:56 +00:00
check.pl … and $__perlname (for perl5 ipv perl, etc.) 2008-04-01 16:26:42 +00:00
check.t check return value of unlink(2) when trying to remove an existing HISTFILE, 2008-07-06 22:41:09 +00:00
copyright remove advertising clause from mksh distribution: while I’d still prefer 2008-04-22 11:47:57 +00:00
dot.mkshrc add new builtin “realpath” calling realpath(3) on its argument, skipping 2008-05-17 18:27:57 +00:00
edit.c • alloc() can’t fail, afree() can take NULL 2008-05-17 18:47:03 +00:00
eval.c • alloc() can’t fail, afree() can take NULL 2008-05-17 18:47:03 +00:00
exec.c • alloc() can’t fail, afree() can take NULL 2008-05-17 18:47:03 +00:00
expr.c mostly revert 100480A853206FB56FA and parse utf-8 lead bytes ourselves 2008-04-20 00:24:26 +00:00
funcs.c fix the RCS IDs 2008-06-08 17:16:25 +00:00
histrap.c check return value of unlink(2) when trying to remove an existing HISTFILE, 2008-07-06 22:41:09 +00:00
jobs.c optimise based upon the following assumption: 2008-05-17 19:03:25 +00:00
lex.c • add code to support GNU bash’s “&> file” I/O redirection extension, 2008-06-28 22:51:56 +00:00
main.c • alloc() can’t fail, afree() can take NULL 2008-05-17 18:47:03 +00:00
Makefile remove check_category “pdksh”, it starts to make trouble and was never 2008-06-21 19:20:15 +00:00
misc.c • alloc() can’t fail, afree() can take NULL 2008-05-17 18:47:03 +00:00
mksh.1 • add code to support GNU bash’s “&> file” I/O redirection extension, 2008-06-28 22:51:56 +00:00
setmode.c • more unsigned → unsigned int 2008-04-19 22:15:06 +00:00
sh.h check return value of unlink(2) when trying to remove an existing HISTFILE, 2008-07-06 22:41:09 +00:00
shf.c • alloc() can’t fail, afree() can take NULL 2008-05-17 18:47:03 +00:00
strlcpy.c • strlcpy.c: remove superfluous rcs ids in comments 2007-04-23 11:33:26 +00:00
syn.c • add code to support GNU bash’s “&> file” I/O redirection extension, 2008-06-28 22:51:56 +00:00
tree.c • alloc() can’t fail, afree() can take NULL 2008-05-17 18:47:03 +00:00
var.c • alloc() can’t fail, afree() can take NULL 2008-05-17 18:47:03 +00:00