in commitid 1004D8283F068C41C3C was bogus; it fixed Jb_boin’s issue
but izabers’s 「var=foo; echo "${var/*/x}"」 was broken; in fact we
only want to not do the looping for // if the pattern matches much.
Also, fix a spelling mistake in the manpage and change some wording
to also work with associative arrays (in the future; no change).
• support NSIG_MAX from http://austingroupbugs.net/view.php?id=741
and make a TODO for later to use sysconf(_SC_NSIG) at runtime
• bounds-check signals (e.g. no smaller than 1, but smaller than NSIG)
• align trap errorlevel with other shells
• make trap match what’s in POSIX and fixup the manpage
• refactor some code related to signals
• hide from kill builtin both EXIT and ERR pseudo-signals
GNU C11 (Debian 20150413-1) version 5.0.1 20150413 (prerelease) [gcc-5-branch revision 222050] (x86_64-linux-gnu)
including ASan (testsuite) and Valgrind (short)
for mksh but not lksh; bump to R51-alpha.
While here, tweak build scripts a bit, fixup MirBSD-specific Makefile
things, remove part of a comment that’s uninteresting.
‣ : → \:
‣ alias → \alias
⇒ except in some internally used cases, where we use \builtin alias
‣ command . → \command .
• protect Korn Shell builtins from aliases and functions, e.g:
‣ typeset → \builtin typeset
⇒ also unravels the “local” alias used
‣ print → \builtin print
• protect internally-used things from aliases
‣ “let]” is not a valid function name
‣ “set” is POSIX so we don’t expect anyone to override it in a function
• use “command -v” instead of “whence -p” (“which”) in most
places; thanks izabera from #ed on IRC for pointing out
that “command -v” is POSIX – except, “whence -p” a̲l̲w̲a̲y̲s̲ looks
for an executable and shows its full pathname; “command -v”
also resolves to aliases, functions and builtins, so only use
it where it makes any sense (both never output to stderr)
• make most of dot.mkshrc work in the face of such aliases
‣ “ulimit -c” is used; this is not POSIX, and not portable;
maybe we should make ulimit accept-and-ignore the most
common limits even if the OS doesn’t use them?
• update list of builtin aliases in the manpage
• keep the Kochan book at 3rd edition because 4th is not a paper book
• keep POSIX at 1993 because I’m actually unable to find an ISBN or
other bib ref for the 2013 version…
‣ not like oksh did, but using mksh’s built-in features
• handle suggested __pure additions
• revert cid 1004F7F096867C83CF0
‣ always use our wcwidth code
‣ only use our strlcpy code if none found
• fix a couple of gcc-snapshot and clang/scan-build warnings
• mksh R49~rc1
Add a proper suspend builtin that saves/restores the tty and pgrp
as needed instead of an alias that just sends SIGSTOP. Login shells
may be suspended if they are not running in an orphan process group.
TODO: I am seriously considering following Chet and changing
the way this works, by explicitly dropping privs unless the
shell is run with -p. Every other shell does it like mksh,
except Heirloom sh, which on the other hand doesn’t know any
explicit set -p or set +p (though it doesn’t know set +foo
for any foo either).
┌──┤ QUESTION: Do we need the ability to do this:
│ tg@blau:~ $ ./suidmksh -p -c 'whoami; set +p; whoami'
│ root
│ tg
If not, I’m seriously considering to drop set ±p as well,
only parse -p on the command line, with +p being the default,
and dropping FPRIVILEGED.
Thanks to RT for noticing and jilles for initial follow-up
discussion, as well as Chet Ramey for doing the sane/secure
thing instead of following Debian.