aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-02-07Remove unused function.Rob Landley
Ethan Sommer noticed that chown is using chgrp_main() due to OLDTOY, so the wrapper function isn't needed.
2021-02-07Add lots of "static" annotations, make a couple things use FLAG() macros, etc.Rob Landley
2021-02-06netcat.test: reduce flake.Elliott Hughes
Starting two netcats at the same time and expecting them to be able to talk to each is a little optimistic. I don't know whether `sleep .1` will be sufficient, but wanted to try that before going to `sleep 1` since neither the toybox nor the github nor the Android infrastructure is running these tests in parallel, those seconds add up. Right now this has a ~20% flake rate on the Android infrastructure. I was able to reproduce the flake locally with `while true ; do make test_netcat ; done` on my desktop before this patch, but not after. (Though my desktop is way overpowered for just running that, whereas the build servers tend to be pretty busy, which is why I reserve the right to return later with a longer delay.)
2021-02-06netstat: various fixes.Elliott Hughes
Avoid fgets() into toybuf other than to skip header lines, preferring fscanf() or xgetline() instead. Remove the early returns if we fail to skip a header line (fixes #62). Fix `netstat -xl` which was previously broken (because only -a would include listening sockets). Fix a variety of formatting issues, bringing the diff between toybox netstat and net-tools netstat down (which was what I used for testing). Use FLAG() more consistently.
2021-02-06Cleanup pass on netstat.Rob Landley
2021-02-03Cleanup pass on modprobe.Rob Landley
I need to set up a test environment for this...
2021-02-01Minor tweak.Rob Landley
2021-02-01rm: Add testcase for "rm -f <readonly_filesystem>/missing_file"Yi-Yo Chiang
2021-02-01rm: Check file existence with lstat() explicitly if "-f" is specifiedYi-Yo Chiang
Instead of unlink() && check errno, call lstat() explicitly to check file existence if "-f" is specified. There is a regression when if the path to be removed is nonexistence and within a readonly filesystem, then unlink() could set the EROFS errno instead of ENOENT, thus screwing up the output of `rm`.
2021-02-01The new TEST_GLUE config symbol for [ ] can't have TOYBOX prefixRob Landley
or else singlemake enables it for all commands. (I was trying to move it out of the command namespace, but it's not a global config option either...)
2021-01-31Yank TODO note-to-self accidentally checked in, and fix "make test" standalone.Rob Landley
2021-01-31Elliott wants the test->[ symlink back. Enable when either sh or test enabled.Rob Landley
2021-01-30Fix a couple of test regressions from last commit adding function() plumbing.Rob Landley
2021-01-28toysh: start of function call logic.Rob Landley
2021-01-28Shut gcc's "is not actually used uninitialized" false positive warnings up.Rob Landley
2021-01-26A few more getty cleanups.Rob Landley
2021-01-26getty/telnet/tftpd: minor cleanup.Elliott Hughes
Remove STDIN_FILENO and use FLAG(). Use xsetspeed() rather than have a duplicate table. Inline getty's print_prompt(). There's still a lot of cleanup needed here, in particular use of toybuf and removal of the inappropriately-named HOSTNAME_SIZE (and ideally sharing that logic with login(1) which already contains a better implementation of it).
2021-01-26Fix bug pointed out by asm89 and add test.Rob Landley
2021-01-23Fix grep bug where -f /dev/null added "" regex matching everything,Rob Landley
and address TODO where -z was still splitting patterns on \n
2021-01-18Remove redundant blake2 mention and move base32 into the implemented list.Rob Landley
2021-01-15Cleanup base32 slightly.Rob Landley
2021-01-14A few more shell tests.Rob Landley
2021-01-13Fix "date -I" segfault and teach lib/args.c that "I(opt):;" short opt withRob Landley
no argument returns NULL same as --opt without =
2021-01-08chmod.test: fix the tests to work on mksh as well as bash.Elliott Hughes
mksh doesn't support the {a..b} bashism or the ${!name} bashism, causing the tests to fail on Android. This works for me on both mksh and bash (both tested on Debian).
2021-01-07new toy: base32Moritz Röhrich
Add new toy `base32`. Add tests for `base32`. base32 is added by adapting the base64 encode/decode function to also do base32 encoding/decoding. Then their respective main functions set up the global parameter `n` to be the number of bits used in the encoding (5 for base32 and 6 for base64) and `align` to align the result to a certain length via padding. These are deliberately kept as parameters to enable future expansion for other bases easily.
2021-01-06seq: always xwrite.Elliott Hughes
Pointed out by the compiler combined with glibc's use of __attribute__((__warn_unused_result__)) on write().
2021-01-06main.c: construct a combination locale to add UTF-8.Elliott Hughes
We need <xlocale.h> for newlocale(3) on macOS, despite it being in POSIX 2008's <locale.h>. musl apparently doesn't have <xlocale.h>, so that's another trick to teach to portability.h...
2021-01-01Fix comma regression reported by Denys Nykula.Rob Landley
2020-12-26toysh: fix break/continueRob Landley
2020-12-25toysh fixes and testsRob Landley
2020-12-25Add MacOS 11.0 to CI BuildsEric Molitor
2020-12-19Fix (( )) quote termination.Rob Landley
2020-12-19FS_ENCRYPT_FL introduced too recently to depend on, use constant.Rob Landley
Note: can't put in portability.h because it's a linux/ include.
2020-12-18Add seq INT_MIN test.Rob Landley
2020-12-18seq.c: fix itoa for INT_MIN in case itoa gets used elsewhere.Elliott Hughes
It can't actually be used for INT_MIN in the current context because the `dd += increment` on line 100 means that even if "last" is INT_MIN, we won't take the fast path because INT_MIN - 1 isn't representable.
2020-12-18Andy Hu wants mount -tnomsdos,smbfs to work.Rob Landley
2020-12-18Elliott said that chmod 000 debris was confusing host rm -rf, and macosRob Landley
couldn't handle chmod +s in /tmp. Try to make test_chmod clear out debris and teach make clean to chmod -R generated before deleting it.
2020-12-16chmod.c: mask out the file type bits.Elliott Hughes
The kernel will do this for us on both Linux and macOS, but error messages are a bit misleading if we don't do it ourselves --- it can look as if the failure is because of the type bits.
2020-12-15Speed up count: use 64k block size, update display at most 4x/second.Rob Landley
2020-12-15Implement set, trace support, and function call context stack.Rob Landley
2020-12-14main.c: fix UTF-8 on macOS.Elliott Hughes
Unfortunately neither "C.UTF-8" nor "UTF-8" works on *both* OSes...
2020-12-14Add test for FEXTRA flag on gunzipPuck Meerburg
2020-12-14Follow RFC1952 when consuming gzip headerPuck Meerburg
The FEXTRA field, indicated by bit 2 of the flag byte, contains arbitrary extra data, prefixed by a 16-bit length value. The previous code skipped over the length, but not the actual contents, breaking decompression of certain files.
2020-12-12Speed up seq: use toybuf for block writes and add an integer fast path.Rob Landley
2020-12-11Sigh, remove debug code checked in by mistake.Rob Landley
2020-12-11The "fall back to C.UTF-8" check was backwards, and make TOYFLAG_LINEBUFRob Landley
configurable.
2020-12-08Remove last traces of CONFIG_TOYBOX_I18N.Elliott Hughes
`make macos_defconfig` was grumbling.
2020-12-08Better conversion of toycans-big.jpg to png. (Just rotate 90 degrees.)Rob Landley
2020-12-07Rename randbuf and hook up -sRob Landley
2020-12-07Promote pwgen.Rob Landley