aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2014-12-13Remove more strncpy() calls.Rob Landley
The semantics of strncat() and strncpy() are non-obvious, so let's not use 'em. Both zero all their remaining buffer space, and with strncat() the size is the space left at the _end_ of the string (not the size of the buffer) so it's way too easy to stomp memory you don't own. As long as we have to measure stuff ourselves to get it right, just use memcpy().
2014-12-11here's a patch that should let us replace toolbox's chcon.Elliott Hughes
(it also adds a feature, -R, because toybox makes that so easy.) you'll probably want fancier configuration here because although the --as-needed works okay, a typical Ubuntu box will have the .so but not the .h files. i did consider adding a toys/selinux/ directory, but given that existing tools like ls and id will want -Z SELinux options, i wasn't sure whether you'd think it was worth segregating the SELinux-only toys. note that this won't help the tizen smack users (and patch for smack won't help SELinux users). so you might want to think about where you'd like us to be aiming: #if USE_SELINUX/USE_SMACK in all the relevant places, or a toys/selinux and a toys/smack (though we'd still need #if in at least ls and id), or a lib/security.c that concentrates all the differences into one file?
2014-12-10Make unescape_delimited_string() copy the string so error reporting isn't so ↵Rob Landley
messed up.
2014-12-10Fix some sed bugs and improve error reporting.Rob Landley
A newline after 'b' commands in -e command line patterns was being discarded as whitespace, a single element regex match on a {} was leaving stale state for the next line, and giant -e blobs of instructions were saying things like problem at character 432 (note: nulls inserted for regex processing aren't always cleaned up, screws up error reporting).
2014-12-04Work with buildroot's extensively patched uClibc, and for nommu support move ↵Rob Landley
xfork() to portability.h and #ifdef based on __uClinux__ (which seems to be the nommu compiler define).
2014-12-04Implement xstrncat() and fix xstrndup().Rob Landley
2014-12-04Add shred.Rob Landley
2014-12-03More gzip stuff: now creates -0 compression files (store only), and does so ↵Rob Landley
to stdout.
2014-12-02Fix bug pointed out by Elliott Hughes ("vmstat 1" should repeat endlessly), ↵Rob Landley
and remove final delay (after all output) for "vmstat 2 3" case.
2014-12-02Note posix mailing list posting correcting a bug in the web version of the ↵Rob Landley
standard.
2014-12-02Don't mount a filesystem over an existing one with the same /dev and /dir.Rob Landley
The OS mostly catches this for block devices, but calling "mount -a" twice shouldn't overmount tmpfs entries with new tmpfs instances. (This needs a test suite entry, and the test suite needs a root context to run in...)
2014-12-02Switching on fortify was not kind to the pending directory. Fix the actual ↵Rob Landley
build break (open(O_CREAT) without permissions).
2014-12-02Start of deflate compress-side code, mostly refactoring and stubs so far.Rob Landley
2014-12-01Ashwini Sharma pointed out that "mkdir sub; ln -s . sub/up; du -L sub" ↵Rob Landley
shouldn't loop endlessly.
2014-12-01Refactor expr and add another test entry that works with TEST_HOST=1 but not ↵Rob Landley
with the one in pending.
2014-11-30Tests for operator priority groupings.Rob Landley
2014-11-30Remove the strncpy from mountpoint, and make a lot of other changes while ↵Rob Landley
I'm here (to be described on the mailing list).
2014-11-29The "re-exec to regain root permissions" logic broke the error message when ↵Rob Landley
calling root-only commands through the multiplexer. It would say "no such command" when it should say "not root".
2014-11-29Minor whitespace cleanups.Rob Landley
2014-11-29expr.c: Added '==' sign into list of operations. Also added support for ↵Ashwini Sharma
regex pattern match.
2014-11-28Improve error reporting in parallel build. (On error, wait for all children ↵Rob Landley
to finish before exiting.)
2014-11-28Make sendfile use libbuf.Rob Landley
2014-11-28Tiny in-passing cleanups to more.c.Rob Landley
2014-11-28Check in most recent release notes.Rob Landley
2014-11-28When running a test, the diff is always an ascii diff, not binary.Rob Landley
2014-11-28Add "change" subdirectory to make clean.Rob Landley
2014-11-28Add "make change" target to build the big toybox binary as a bunch of little ↵Rob Landley
ones (in the "change" subdirectory), and tweak scripts/make.sh to avoid redundant work when rebuilding.
2014-11-27sed: c needs to trigger range logic like d, D works like d when there isn't ↵Rob Landley
anything left in the line, and more tests.
2014-11-27New ifconfig tests from Cynt Rynt.Rob Landley
(I added the "only run if root" stanza at the beginning.)
2014-11-25Update dmesg, loosely based on a patch from Elliott Hughes.Rob Landley
Probe the default buffer size, replace the constants with FLAG_x macros, add -r, replace the byte at a time output with a single xwrite(), more comments.
2014-11-25Variant of a patch from Ashwini Sharma, making df /dev/node work and ↵Rob Landley
tweaking the spacing. I didn't apply the POSIXLY_CORRECT gnuism because it's a can of worms (as would be LSB_CORRECT), and you can presumably alias df="df -P" if you want that. Possibly in future I should factor out the "readahead and align columns based on measuring the largest value in each" code from ls and apply it here.
2014-11-24Android-related roadmap.html updates.enh
most notably: * Android switched to mksh several releases ago. * system/core/reboot is Android's reboot(1) (and sdcard is how emulated sdcards work in production, not a testing thing). * I removed all the "apparently unused" tools from the tree, since they were all actually unused with the exception of lsusb which people would build as/when they needed it. (which may need resurrecting when they come back and find there's no "lsusb -v" in toolbox.)
2014-11-24Tweak the "ignoring return value" fortify workaround for readlinkat.Rob Landley
We zero the buffer and if the link read fails that's left alone, so it's ok for the symlink not to be there. Unfortunately, typecasting the return value to (void) doesn't shut up gcc, and having an if(); with the semicolon on the same line doesn't shut up llvm. (The semicolon on a new line would, but C does not have significant whitespace and I'm not going to humor llvm if it plans to start.) So far, empty curly brackets consistently get the warning to shut up.
2014-11-22As long as Android's going to require fortify, fixup the warnings it generates.Rob Landley
2014-11-22Whitespace/code style.Rob Landley
2014-11-21A patch against your current ToT that builds in AOSP master.Elliott Hughes
2014-11-21Don't include asm/* files directly.Rob Landley
2014-11-21Patch from Elliott Hughes for Android/bionic build.Rob Landley
2014-11-19Make md5sum and sha1sum work on big endian systems.0.5.1Rob Landley
2014-11-19Fixups for the android/bionic build probes patch.Rob Landley
The CFG_* symbols are always defined so if() can use them as compile-time constants, so don't if defined() them. Doing USE_BLAH() around variable definitions opens up the same potential for config-dependent build breaks as #ifdefs do, just make the whole command depend on the symbol for now, factor out the utmpx infrastructure later. The PTY probe was always failing because it used NULL without #including the header that defines it. Substitute 0 instead.
2014-11-19probe for getspnam(), forkpty(), utmpx, replace sethostname()Isaac Dunham
Android is missing all of these; we need to probe for some so we have a config symbol to depend on. sethostname() is easily replaced. We got termios.h via pty.h; now it's not included in configure-step tools, so we need termios.h to generate globals.
2014-11-19Fix "tail -c 10" segfault spotted by Lukasz Szpakowski.Rob Landley
Once we've read through the initial TT.bytes backlog we discard the extra data, meaning we adjust the remaining amount each time so the overflow is zero bytes. We were doing the adjustment right, but not zeroing out the overflow counter after we did so.
2014-11-18More sed bugfixes.Rob Landley
2014-11-17sed: fix 'q', and { }, and } after s/// with no semicolon.Rob Landley
2014-11-17More sed corner cases. (Empty regex repeats previous regex, implement -i, etc.)Rob Landley
2014-11-16Fix more sed bugs.Rob Landley
2014-11-16Fix sed 'b' with no label and 'N' in general.Rob Landley
2014-11-15More sed bugfixes. (Did you know s/[/]// is a valid sed expression?)Rob Landley
2014-11-15Debugging pass on sed: make the existing test suite pass.Rob Landley
2014-11-14Add a few more sed tests.Rob Landley