aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2014-10-26xexec() recursion limiter has to go after rebound or toy_init() zeroes it.Rob Landley
2014-10-26Cosmetic tweak: no trailing spaces when ./toybox lists command names.Rob Landley
2014-10-24Basic sed range support, enough for "sed -n 9,11p README" to work.Rob Landley
2014-10-22Teach ln -f to leave original target alone if link creation fails.Rob Landley
Suggested by Ashwini Sharma, I wound up implementing it by creating the new link at a temporary name and renaming it over the old one instead of renaming the old file out of the way and putting it back if it failed. (Because "mkdir -p one/one/blah && ln -sf /bin/one one" would otherwise rename one/one out of the way and only notice it can't delete it way at the end when recovery's darn awkward, vs create new thing and if rename fails (including EISDIR) that's the main error path. And yes the temporary name is in the same directory as the destination so we never rename between mounts.) link over the old one instead of renaming the old file and renaming it back.
2014-10-20Random in-progress snapshot of sed, not finished yet.Rob Landley
2014-10-20More static analysis fixes from Ashwini Sharma.Rob Landley
2014-10-20Add TOYBOX_NORECURSE so xexec() won't make internal function calls.Rob Landley
2014-10-19nsenter: A tool to use setns(2)Andy Lutomirski
This implements all of the namespace parts of nsenter, but UID and GID switching are missing, as are -r and -w (both because they're not strictly necessary and because the nsenter manpage has an insufficient description of how they work).
2014-10-17unshare: Fix help and option parsingAndy Lutomirski
The help text was inconsistent, and option parsing was completely broken (the options mostly did the wrong thing).
2014-10-18Factor out printf-style escape parsing logic from echo.c.Rob Landley
2014-10-16Even bigger ip.c, from Ashwini Sharma.Rob Landley
2014-10-14Use O_CLOEXEC instead of O_RDONLY to signal loopfiles_rw() to close filehandles.Rob Landley
2014-10-14Fix last night's mv commit (use dest, not source).Rob Landley
2014-10-14Implement mv -f and -i.Rob Landley
2014-10-13Started over on sed (by reading the posix spec).Rob Landley
2014-10-10acpi: implement -ctV, fix recursion, plug a small leakIsaac Dunham
* acpi_callback had blindly assumed that a path of 26 chars or more was the right depth; rely on depth from dirtree root * acpi -c shows cooling device state some backlights are set up so that they will report dimmer as higher, but that's a hardware issue that can't be sanely worked around. * acpi -t shows temperatures this implementation will pick up fan, battery temperatures, etc. (but currently not hwmon-type temperatures, or hdd temps; acpi 1.7 does not measure these either) we handle milli-C (typical) and deci-C (I've seen this on Qualcomm batteries, and not yet anywhere else) we do *not* handle deci-K yet * acpi -V shows all sensors * without saving the result of dirtree_path() to free later, we had a slow leak. all callbacks call this once, so save it in GLOBALS() acpi -t happens to need this anyhow, though using openat()/readall() instead of readfile() would work.
2014-10-09Various bugfixes (mostly resource leaks) from Ashwini Sharma's static ↵Rob Landley
analysis, plus occasional tweak by me while reviewing them.
2014-10-09Fix use-after-free spotted by Ashwini Sharma's static analysis.Rob Landley
We xstrdup() an optargs string to avoid modifying our environment space (because it can change what "ps" shows to other processes), and then parse out colon delimited strings and save them in globals that can later be used in the -v codepath and so on. But those globals _aren't_ strdup (no point) which means we can't free the string while we're still using pointers into the middle of it. So move the free to the end. (I hardly ever test with CFG_TOYBOX_FREE switched on because even nommu doesn't need it.)
2014-10-08Update status lists. (Once the pending-not-in-pending files go away (see ↵Rob Landley
toys/pending/README), this can be probed from the source.)
2014-10-07Basic update of the roadmap and status pages. (Both need a good scrub and ↵Rob Landley
polish beyond this.)
2014-10-02Release notes for 0.5.0.Rob Landley
2014-10-02Added tag 0.5.0 for changeset 7afd32673a5cRob Landley
2014-10-02Workaround for musl's faccessat bug (the rm -r "error: is a directory" thing).0.5.0Rob Landley
The Linux man page says I can use AT_SYMLINK_NOFOLLOW. It works in glibc, uclibc, and klibc, but musl returns -EINVAL any time you pass in that flag and the maintainer says that's not a bug and insists the man page and those other libraries all change to match musl's behavior. Toybox uses it to avoid scheduling unnecessary metadata writes for things we're about to delete (have to chmod unreadable directories so we can descend into them to delete their contents, the chmod happens before we descend so the disk I/O has plenty of time to be scheduled) because the extra writes wear out SSD faster. It's just an optimization and I don't really care if it works _well_ (the fchmodat call _also_ takes AT_SYMLINK_NOFOLLOW so that's covered), but musl's behavior uniquely makes the check always error and thus breaks normal "rm -r". Yes this workaround is checking #ifdef __MUSL__ which the library does not supply (because its code is perfect and will thus never need to be worked around). You can CFLAGS=-D__MUSL__ if you don't echo "#define __MUSL__" >> include/features.h when installing the library.
2014-10-01Bugfix from Ashwini Sharma: Z timezone required by posix for touch but not ↵Rob Landley
for libc, so we have to implement it here.
2014-09-28Updated version, having complete support for ip _link_, _addr_, _rule_, ↵Ashwini Sharma
_route_ and _tunnel_ options.
2014-09-28Fix two mount bugs: 1) Don't skip a filesystem type when setting up loopback ↵Rob Landley
mount, 2) Don't stop checking filesystem types due to EBUSY, it may mean already mounted by another filesystem type you haven't tried yet.
2014-09-28mount: terminate list so unknown user mount attempts don't endlessly loop, ↵Rob Landley
add better error reporting.
2014-09-28Brown paper bag time: comma_scan() didn't work for anything but the last entry.Rob Landley
2014-09-27Multi-build single.sh should exit with an error when build breaks.Rob Landley
2014-09-27Cleanup pass on groupdel.Rob Landley
2014-09-27Allow single.sh to build more than one command per invocation.Rob Landley
2014-09-27Untangle id/groups/logname so single.sh can build each one standalone.Rob Landley
2014-09-27Have OLDTOY emit (redundant) function prototype so single.sh can build ↵Rob Landley
OLDTOY standalone (if it has its own config symbol).
2014-09-27Don't segfault for --help of single.sh build of OLDTOY commands that use ↵Rob Landley
another command's help.
2014-09-26The only illegal characters in a username are ":" (field separator), "\n" ↵Rob Landley
(line separator), and "/" (filename separator). Restricting usernames to the legacy posix character allowed set (for filenames, so the $HOME directory is creatable on VFAT and similar) means you can't have UTF-8 usernames. Linux allows any character but / and NUL in filenames. Since root is creating these entries, we assume root knows what it's doing.
2014-09-26Separate more commands so single.sh can build them standalone.Rob Landley
2014-09-22When killall was invoked without arguments, there appeared segmentation fault?ukasz Szpakowski
2014-09-22Fix du test: du symlink -> "0\tsymlink"Felix Janda
2014-09-22Respond to two static analysis issues in dirtree_path() reported by Ashwini ↵Rob Landley
Sharma. dirtree->name is an array, not a pointer, so can't be zero. Remove the test. We dereference plen without checking it for null but calling dirtree_path(0, 0) is pilot error: only the _first_ call can have plen = 0. Add a comment.
2014-09-21Start on ping.c.Rob Landley
2014-09-20Tweak portability.h for uClibc version in buildroot defconfig.Rob Landley
I've been locally patching uClibc to not violate posix-2008 (you don't need to define a GNU macro to get a posix function), but uClibc is obsolete and moribund (development peaked in 2006, last bugfix release was over 2 years ago), and the largest remaining user (buildroot) doesn't bother to apply such a patch. Since even buildroot is slowly migrating to musl-libc, just do the portability tweak for what the last release of the old thing actually did.
2014-09-20Always call setlocale if I18N is enabled, so nested toy_exec() can switch it ↵Rob Landley
back off if necessary.
2014-09-20Delete generated/README.txt (the contents are in code.html now) so clean can ↵Rob Landley
just remove the "generated" directory entirely.
2014-09-20Capitalize "toybox" more consistently on the about page.Rob Landley
2014-09-20Fluff out the documentation some more.Rob Landley
2014-09-20Remove debug echo checked in by mistake.Rob Landley
2014-09-20Forgot to check in the updated makefile when I moved the testsuite.Rob Landley
(Did you know you can test individual commands with scripts/test.sh command? Now you do...)
2014-09-20Typo from the dawn of time: toybox is not capitalized the way BusyBox was.Rob Landley
It's just a word. Capitalize at the start of the sentence, otherwise don't. Yeah, it could be always capitalized as a proper name but since the command "toybox" is all lower case, that would be weird.
2014-09-20The ancient GPL (copied from the 2.6.12 kernel) build infrastructure is ↵Rob Landley
actually in the "kconfig" directory, not under scripts. Remind me to write a new one from scratch... (Someone actually submitted a basic kconfig rewrite in awk once, but until I bite the bullet and write my own awk.c, I just don't know awk well enough to maintain a large script written in it. Back when I maintained kernel.org/doc I wrote http://landley.net/hg/kdocs/file/tip/make/menuconfig2html.py but I am NOT reintroducing python as a build dependency. And neither actually implemented actual menuing part. So... todo list.)
2014-09-20Move testsuite out of scripts/test into its own top level tests directory, ↵Rob Landley
and make ctrl-c kill "make test" more reliably.