Commit graph

12 commits

Author SHA1 Message Date
Yifan Hong
c6ad685a7b Introduce sh.vendor_ramdisk.
Test: pass
Bug: 156098440
Change-Id: Ie267b05c250a5f1831ae6d25aad9ea7bdc66ab2a
2020-10-28 10:25:30 -07:00
Elliott Hughes
a5d35a625a Upgrade to mksh R59b.
R59b is a must-have bugfix upgrade for R59 (not R58):

[tg] Handle other tmux $TERM types, pointed out by multi via IRC
[tg] Fix typo in FAQ
[tg] y='a\*b'; [[ $x = $y ]] regression (Martijn Dekker) fix
[l0kod] Defuse CLIP OS O_MAYEXEC support (cf. LWN)
[tg] Make set +o output a command to restore the currently set and
(new!) cleared options, keep a reset state per session (experimental)
[tg] Correct documentation and code regarding to argv[0] parsing: first
‘-’ for login shells, then ‘r’ case-insensitively for restricted shell,
then “sh”*, again case-insensitively, for BINSH_* modes; add tests
[tg] On OS/2, allow case-insensitive name for direct builtin call
[tg] Always skip startup files if direct builtin call
[tg] Avoid some sometimes-redundant startup codepaths

Test: treehugger
Change-Id: I7b0a1d37b4d3fdf1f78569458769e89dca755fcb
2020-05-20 17:17:13 -07:00
Elliott Hughes
2e46594a0b Upgrade to mksh R59.
R59 has some major fixes, also introducing breaking changes:

[tg] Repair out-of-tree builds (noticed by rsc)
[tg] Work around a glibc on Hurd issue in testsuite
[komh] OS/2 filesystem mtime granularity is two seconds (as in FAT)
[tg] Replace while with goto: Coverity was confused
[tg] Fix invocation of some builtins when external utility absent
[komh] Improve automatic executable suffix for test builtin
[tg] Style code, refactor, clean up, optimise
[tg] Use cached egid in test builtin
[tg] Make bind builtin output reentry-safe; safety fixes
[tg] If basename(argv[0]) after leading dash removal begins with an ‘r’
enable restricted shell flag; reported by pmjdebruijn via IRC
[tg] Fix code example in manpage for how tab completion escapes
[tg] Match full extglob pattern RHS of [[ string comparison like ksh93
[tg] Implement which with -a in dot.mkshrc
[tg] Remove global builtin (use typeset -g)
[tg] alias, command, whence: Print alias names quoted
[tg] Implement a new quote-region (Esc+Q) editing command
[tg] Document all built-in aliases (requested by msiism via IRC) and
those aliases and functions shipped in dot.mkshrc; completely overhaul
builtin and reserved word documentation, for consistency
[tg] The manual page now features properly spaced em dashes ☻
[tg] Document that test x = y doesn’t extglob, only [[ x = y ]] does

R58 contains a lot of fixes and improvements:

[lintian] hyphen-used-as-minus-sign (on jessie, not later, ‽‽‽)
[tg] Fix system info gcc dump{machine,version} shell escaping level
[tg] Document KSH_VERSIONNAME_VENDOR_EXT in Build.sh
[tg] Be more explicit about the LTO bug exposed by check.t
[Todd C. Miller] Add -x (file locks) and AIX-specific -r ulimits
[tg] Handle Midipix as test environment and fix some warnings
[tg] Fix some Build.sh issues as Mirtoconf is now used by MirCPIO and
MagicPoint
[komh] Improve CRLF to LF conversion
[komh] Ensure ECHO mode is enabled at startup so read has local echo
[komh] Let check.pl retain the PERLIO env variable
[komh] Unbreak nounset-1 test on systems with drive letters
[komh, tg] Make ulimit-3 test work without |& (that is, incomplete
ports, i.e. those with -DMKSH_NOPROSPECTOFWORK)
[tg] Disable xxx-stat-1 test for now, fails when run as root
[tg] Drop Build.sh flags -c combine, -c lto
[Martijn Dekker] Exit 126 on execve(2) failure, not 1 (e.g. E2BIG)
[tg] Behave set and export/readonly-on-read-only-variables when run with
command and command dot, bugreports by Martijn Dekker
[tg] dot.mkshrc: simplify; enhance (un)setting locale example
[tg, selk] Catch build errors earlier
[tg] Add -fno-lto (if GCC is detected) to CFLAGS and LDFLAGS
[tg] Limit HISTSIZE to 65535, as long pre-announced
[tg] Unbreak testsuite selftest-tty-absent for lksh
[tg] Begin work on support for neatcc (needs neatcc to evolve first)
[tg] Fix possibly not enough aligned access in struct job
[tg] Support going full setugid by running “set -p” once interactive
[tg] Document another (arcane, almost nowhere needed) definition
[tg] Improve code legibility and testsuite reliability and maintenance
[tg] Speed up trivial += cases (LP#1855167)
[tg] Some further code and memory optimisation and test coverage
[tg] Document that += is always string append (LP#1857702)
[tg] Fix “set -e appears active within eval but isn’t” reported by
Martijn Dekker and another bug related to using set ±e inside eval
[tg] Handle parameter assignment in front of invocations of POSIX-style
functions like ksh-style ones and external utilities; cf. Debian #935115
[tg] Fix bad memory access for invalid syntax (LP#1857828, LP#1857826)
[Brian Callahan] Update MALLOC_OPTIONS-using testcase for newer OpenBSD
[tg] Support lacc as compiler (just detecting, no change), thanks Brian
[tg] Share __IDSTRING with jupp
[tg] Update string comparison/pattern documentation
[tg, veedeeh] Document vi command line editing mode state better
[tg] Add FAQ2HTML.sh to convert mksh.faq to local valid XHTML+CSS
[tg] Correct backslash expansion documentation; caveat re. 16-bit UCS
[tg] Fix extra empty field on IFS-NWS trim expansion (Martijn Dekker)
[tg] Improve code performance, quality, robustness and correctness
[tg] Allow ${x:n} where n is an identifier (veedeeh)
[tg] Permit ‘+’ in alias names, but not leading (Aleksey Cheusov)
[tg] Fix here strings for $@ (LP#1857195), reported by jvdh
[multiplexd] Add vi mode PgDn, similar to PgUp doing history search
[tg] Build.sh fixup unreliable test -n/-z
[multiplexd] Correct documentation of vi mode @c
[tg] Update to UCD 13.0.0
[tg] Use nanoseconds in test -nt / -ot (LP#1855325)

Test: treehugger
Change-Id: Ic466c45d15498770d4852fabdab63cb98bef870a
2020-05-15 16:19:16 -07:00
Elliott Hughes
98df42c3cd mksh: stop loading libc++ and libm.
The dynamic linker unconditionally adds libdl, so this isn't quite down
to just libc, but it's as close as I can get from here.

Unfortunately my timings are in the noise so I can't prove that this
makes any difference in practice, but it can't *hurt*, so....

Test: ldd `which sh`
Change-Id: I9d864120e38d55c85c655ddeaba997cb20e42c6e
2019-09-23 13:29:51 -07:00
Elliott Hughes
47086265c3 Upgrade to mksh R57.
R57 rolls up bugfixes, with few hard changes:

[gecko2] Update operating environment reporting for the Macintosh
[Martijn Dekker] make ${foo#'bar'} in here document behave like ksh93
[Martijn Dekker] quote empty strings for re-entry into shell
[tg, G.raud Meyer] Improve documentation, especially for tty states
[tg] Protect against entering line editing with bad saved tty state
[tg] Fix set -o allexport for arrays (which we apparently do)
[tg] Handle lseek(2) returning -1 as pointed out by Coverity Scan
[tg] Fix left-padding UTF-8 strings
[tg, G.raud Meyer] Fix using the “-m” flag on the command line
[tg] Update to UCD 11.0.0
[multiplexd] Fix a segfault using ^W during search in Vi mode
[tg] Fix an error message; add a test for controlling tty
[tg] Permit unsetting LINES and COLUMNS, for those who need it
[tg] Fix manpage bug (RedHat BZ#1612173)
[tg] Minor spelling cleanup
[tg] Unbreak high-bit7 (nōn-ASCII) heredoc separators (LP#1779179)
[tg] Allow dumping high-bit7-char-containing strings in DEBUG mode
[tg] Add some testcases for behaviour questions popped up in IRC
[tg] Trick a GCC warning, to make up for it ignoring lint(1) hints
[tg] Add O_MAYEXEC support for CLIP OS
[tg] Make dup-to-self with ksh-style fd≥3 closing work; catern via IRC
[tg] Add compat glue for newer GNU groff mdoc to the manpages
[tg] Trigger EXIT trap after single-command subshells (Debian #910276)
[tg] Document set -eo pipefail caveat (LP#1804504)
[tg] Fix MKSH_EARLY_LOCALE_TRACKING warning
[tg] Document that, when your Unix is broken, GIGO applies (LP#1817959)
[tg] Improve error message for inaccessible executables (LP#1817789)

Test: treehugger
Change-Id: Ib5447fc474e509698bd04cdf70ed14b54e84d27a
2019-03-26 12:38:33 -07:00
Sasha Smundak
0ca9e25ae6 Convert Android.mk file to Android.bp
See build/soong/README.md for more information.

Change-Id: I03cc2853dc3eb61a134ff87bd05904182dbeb7c7
Fixes: 122332797
Test: treehugger
2019-01-14 16:24:22 -08:00
Elliott Hughes
373b930724 mksh: allow -fstack-protector-strong.
Our original aim here was to use stack-protector where possible, but
that ironically ended up with us having _worse_ stack protection than
the current default.

Bug: N/A
Test: boots
Change-Id: Iac0f6b2e8ebd670d9c1abfe2ff314ed39c130ff2
2018-10-15 15:59:49 -07:00
Jiyong Park
85b4d48d49 shell is available to the recovery mode
Bug: 63673171
Test: `adb reboot recovery; adb devices` shows the device ID
Test: `adb root && adb shell` works
Change-Id: I89ceb2c8d3519b2e4793830b86aed8f4b7af1572
2018-06-01 12:15:25 +09:00
Elliott Hughes
dd4abe0a6a Upgrade to mksh R56c.
R56c is a bugfix-only release everyone must upgrade to:

[komh] Remove redundant OS/2-specific code, clean up others
[komh, tg] Fix drive-qualified (absolute and relative) DOS-style path support in realpath functionality, partially other places
[tg] Don’t substitute ${ENV:-~/.mkshrc} result again
[tg] Improve OS/2 $PATH (et al.) handling, drive-relative paths
[tg] Add MKSH_ENVDIR compile-time option for Jehanne and Plan 9
[tg] Limit nesting when parsing malformed code (Debian #878947)
[tg] Update wcwidth data with bugfixed script (still Unicode 10; resulting values are identical to glibc git master for extant chars)
[Dr. Werner Fink] Raise some time limits in the testsuite
[Shamar] Add support for the Jehanne operating system
[komh] Set stdin to text mode before executing child processes on OS/2
[komh] Pass arguments via a resonse file if executing a child fails
[Dr. Werner Fink] Early locale tracking as a compile-time option
[tg] Fix regressions introduced with new fast character classes

Bug: N/A
Test: builds and boots
Change-Id: I44da7a8bb9859a0357bcd59891dd4f2cfc199733
2018-02-07 12:46:26 -08:00
Sandeep Patil
fa7594efa4 Move sh_vendor cflags to its own target
The cc_defaults.vendor doesn't work due to VNDK being disabled.
(b/69133815). So, the conversion to soon caused the sh_vendor to start
using $PATH from the environment (instead of the hardcoded one) that in
turn caused vendor shell scripts trying to run system toybox commands.

Bug: 68771183
Test: m -j sh_vendor; adb sync; adb shell; /vendor/bin/sh; echo $PATH
Test: Boot marlin with no denials from init_radio, init_power domains.
Change-Id: Ia90b74a4cffdeba9b53f3b8fb8a56c98386794fa
Signed-off-by: Sandeep Patil <sspatil@google.com>
2017-11-10 09:44:17 -08:00
Jiyong Park
ac07b5ab5e Undef before redefining macros
-Werror,-Wmacro-redefined was turned on because of -Werror, -Wall.
Undefine the overridden macros before redefining them to let compiler
know that the redifinition is intentional.

Test: m -j sh_vendor

Change-Id: If324124e4504f05a37afd1021cff179fdfe4c08e
2017-10-22 17:25:33 +09:00
Jiyong Park
6709053dbb switch to soong
sh is converted to Android.bp

Bug: 66914194
Test: build. sh is found in both /system/bin and /vendor/bin

Change-Id: Iee59e7f2a60c3855c76935e64b8100b7f8eb4802
2017-10-20 11:04:56 +09:00