aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-12-28Sheer pedantry.Rob Landley
2019-12-28Cleanup: use FLAG() macros and new argument variable names.Rob Landley
2019-12-28Allow dlist_terminate() to be called repeatedly on same list.Rob Landley
2019-12-28Next round of sh plumbing: more work on redirect and pipe, use CLOEXEC.Rob Landley
2019-12-28Change variable type to avoid typecast.Rob Landley
2019-12-28tar: fix memory write errorEmmanuel Nicolet
Clear the last byte of the allocated buffer.
2019-12-26Fix setsid with vfork, redo command line arguments.Rob Landley
Switch -t to -c (like man page says), add -w (wait) and -d (detach from tty)
2019-12-23Toysh passes two tests now! Woo! (Otherwise, does not remotely work right now.)Rob Landley
2019-12-23Add "texpect" and add a couple simple examples to sh.test.Rob Landley
2019-12-22gzip: reject non-gzip files in zlib path.Elliott Hughes
It turns out that zlib defaults to just copying data verbatim if the input isn't in gzip format, rather than rejecting it. Explicitly add a check that zlib isn't doing that. (The toybox inflation path already errors out.) Also add the missing test.
2019-12-22Streamline init for NOFORK (fewer unnecessary syscalls for shell builtins).Rob Landley
2019-12-22Bugfix: tee with no arguments was writing to stdout twice.Rob Landley
Add basic smoketest while we're at it.
2019-12-21Add patch -F (fuzz factor)Rob Landley
2019-12-21Tighten up unquote_file()Rob Landley
2019-12-21Very basic patch smoketestRob Landley
2019-12-20Making sh single build work broke other single builds. Fix them again.Rob Landley
2019-12-20patch: support [FILE [PATCH]] arguments.Elliott Hughes
POSIX only mentions -i/stdin, but GNU patch -- and Larry Wall's patch 1.3, found via https://en.wikipedia.org/wiki/Patch_(Unix) -- also support supplying the name of the file to patch and the name of the patch file as optional arguments. The AOSP build makes use of this syntax to patch snakeyaml to remove references to java.beans.* stuff.
2019-12-15Nothing in pending should default y.Rob Landley
2019-12-14Any substitute EVAL should supply its own --Rob Landley
2019-12-14Teach "make sh" to make the multiplexer and builtins, even though it's "single".Rob Landley
2019-12-14Bugfix: xgetline() wasn't returning NULL at EOF.Rob Landley
2019-12-14dirtree.c: avoid spurious EINVAL warnings.Elliott Hughes
An Android engineer complained that they were seeing this when not running as root: $ adb shell ls ls: ./postinstall: Invalid argument ls: ./init: Permission denied ls: ./data_mirror: Invalid argument ls: ./init.environ.rc: Invalid argument ls: ./metadata: Invalid argument acct adb_keys apex From strace, it was here: newfstatat(4, "adb_keys", 0x7fc67eca88, AT_SYMLINK_NOFOLLOW) = -1 EACCES (Permission denied) readlinkat(4, "adb_keys", 0x5e843c7720, 4095) = -1 EINVAL (Invalid argument) So stop looking at st.st_mode (and then deciding to do a readlinkat()) if we didn't actually successfully stat().
2019-12-13fix loopback device mount failwayling
When we "losetup" success need mount loop device. Found this issue on AndroidQ
2019-12-12Next round of toysh work, with associated lib plumbing.Rob Landley
2019-12-06Squash a warning.Rob Landley
2019-12-06du.test: skip on Mac.Elliott Hughes
None of the current tests are relevant on the Mac because small symlinks are inlined into inodes, as are empty directories, so everything's using zero blocks.
2019-12-06printf.test: work around bash 3.2 on the Mac.Elliott Hughes
2019-12-06stat: fix filesystem type on macOS.Elliott Hughes
(Also show unknown values on Linux in hex rather than just "unknown".)
2019-12-06main.c: fall back to user's locale.Elliott Hughes
We still prefer C.UTF-8 for predictability, but macOS doesn't have that.
2019-12-04Fix getopt optstringE5ten
Move longopts after their corresponding shortopts instead of before
2019-12-04ifconfig.test: deflake.Elliott Hughes
::2 can legitimately be part of an IPv6 address, causing the test to fail because the grep matches an unrelated part of the output. Be more explicit about what we're actually searching for (as the previous test already was) to avoid flakiness.
2019-11-24bc: fix a comparison bugGavin Howard
2019-11-23macos_miniconfig: add cp, mktemp, and mv.Elliott Hughes
All three have been in use for the Android build for a while now, and all the tests pass.
2019-11-23file.test: fix /dev/zero major/minor for Mac.Elliott Hughes
2019-11-23Fix iconv and tests on Mac.Elliott Hughes
The Mac iconv_open(3) doesn't follow Unicode TR#22 rules for charset alias matching that bionic and glibc do (and, strictly, POSIX doesn't say you have to even though it's obviously a good idea), so we have to say exactly "UTF-8" rather than "utf8". Additionally, the 2006-era bash 3.2 on current versions of macOS (because it was the last GPLv2 bash) seems to have bugs that cause it to mangle UTF-8 input, so we can't reliably echo a UTF-8 sequence into a file. Use \x in the tests to work around this.
2019-11-23id.test: fix tests on Mac.Elliott Hughes
BSDs call the root group "wheel" instead. Also remove the duplicated "id id" from the progress output.
2019-11-23Fix dev_minor()/dev_major()/dev_makedev() for Mac.Elliott Hughes
Major/minor device encoding is not portable. No two BSDs agree with each other, and Darwin is different again. Everyone does agree on having major()/minor()/makedev() macros, but they disagree whether they should be in <sys/types.h> (the BSDs including Darwin, and old versions of glibc) or <sys/sysmacros.h> (glibc >= 2.26 and bionic). This fixes `ls -l /dev/zero` and `stat /dev/zero` on Mac.
2019-11-23du: use FLAG().Elliott Hughes
2019-11-23Don't use an internal implementation detail of skipnot in a test file.Rob Landley
2019-11-23cat.test: fix tests for Mac.Elliott Hughes
/proc/self/exe doesn't exist, but $C already gives us the path to the binary. /dev/full doesn't have any equivalent afaik, so skip that test if /dev/full is missing.
2019-11-23Elliott pointed out a codepath that could use uninitialized data.Rob Landley
(If DIRTREE_SYMFOLLOW returns ENOENT, skipping the second fstatat() would also skip the else goto error)
2019-11-23Don't test for specific error message output, they vary by libc version.Rob Landley
Check that the filename we fed in is output to stderr.
2019-11-22Sigh. Third attempt to fix trailing slashes in singlemake PREFIX.Rob Landley
(So much jetlag.)
2019-11-22Add getopt(1).Elliott Hughes
Includes new tests.
2019-11-22env.test: be sure to call toybox env.Elliott Hughes
This was failing on macOS because it was calling the system env(1).
2019-11-22mac: build fallocate and stat by default.Elliott Hughes
fallocate is fairly new, but I'm not sure why we didn't have stat on the list already. Having it fixes the truncate tests.
2019-11-20Ahem: work when PREFIX hasn't got trailing / OR when PREFIX is blank.Rob Landley
2019-11-18Work when PREFIX hasn't got trailing /Rob Landley
2019-11-14xargs: distinguish the two "argument too long" error cases.Elliott Hughes
One is really "the command is too long for me to ever call it given other constraints", so leave "argument too long" for the case where it's actually an argument causing the issue.
2019-11-13Pedantic constant annotations to shut up older toolchains.Rob Landley