aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-02-29Fix inverted test.Rob Landley
2016-02-29pending/file: add cpio, tar, zip formats.Isaac Dunham
2016-02-29Fix a typo from last time, and Isaac Dunham's todo list:Rob Landley
- per POSIX, 'cannot open' must be in the 'type' string if open() fails (both EPERM and ENOENT); we only do that if open() succeeds and fstat(fd) fails. - symlink detection (as per POSIX) won't work: opening them O_RDONLY results in following the link, then we fstat() the fd. - file 'FIFO' causes a hang; open() won't return till there's a writer.
2016-02-29Second pass at the ELF type table.Rob Landley
2016-02-26Switch to $! for make.sh process enumeration.Rob Landley
2016-02-25Fix more warnings on 32 bit builds.Rob Landley
2016-02-25Fix bug where mount -o leftover string didn't get passed through to kernelRob Landley
for 2-argument version.
2016-02-25Typecast a printf argument because wchar_t isn't a rigidly defined size.Rob Landley
2016-02-25Musl needs an extra #include.Rob Landley
2016-02-22implement simple 'wget' and port name can be specified in URL if defaultLipi C. H. Lee
port 80 is not used.
2016-02-21lsof cleanupRob Landley
Accept multiple -p, inline filter_matches, convert misleading "char* a, b" to "char *a, b", use readfile() to read a file, use DIRTREE_SHUTUP, don't need { } around a single line, don't modify command line environment space (which changes what ps/pgrep sees).
2016-02-19Implement "insmod -".Elliott Hughes
Also use finit_module if available. Given that "insmod -" requires init_module, maybe this isn't a worthwhile optimization. Given that "insmod /actual/file.ko" is the common use case, maybe it is. Fix a bug in readfileat where *plen would be corrupted if you didn't supply your own buffer (because ibuf is 0 in that case, not a pointer to the start of the allocated space).
2016-02-19Add test_COMMAND for each command, update "make help" to describe TEST_HOSTRob Landley
and VERBOSE=fail, and fix a quote mismatch.
2016-02-19Help text update from Isaac Dunham, tweaked slightly.Rob Landley
2016-02-19Add xxd -p and -r.Elliott Hughes
SELinux denials include hex-encoded paths in the log messages; xxd -r -p is a convenient way to decode them. The heuristics are a little weird to my mind, but match the documentation and observed behavior.
2016-02-18RLIMIT_RTTIME was added to the kernel in 2008, you can't expect uClibc to ↵Rob Landley
have noticed yet.
2016-02-17The perl build's attempt to escape spaces and such in LD_LIBRARY_PATH is _SAD_.Rob Landley
It uses a sed expression that assumes you can escape - to use it as a literal (you can't, it has to be first or last char of the range), and assumes you have to escape delimiters in sed [] context (you don't), and/or that non-printf escapes become the literal character (they don't, the backslash is preserved as a literal), meaning it winds up doing "s/[\-\]//" which is a length 1 range, which is officially undefined behavior according to posix, and regcomp errors out. But if we don't accept it (like other implementations do) the perl build breaks. So collapse [A-A] into just [A]. Testcae taken from perl 5.22.0 file Makefile.SH line 8. (While we're at it, remove an unused argument from a function.)
2016-02-17Add support for getprop -ZTom Cherry
Add support for a -Z option to getprop that will either print the SELabel of a given property if one is provided or print all properties that have been set along with their SELabel. Also, correct a memory leak when freeing TT.nv.
2016-02-17Fix remounting /system on Android.Elliott Hughes
This adds the missing "relatime" option, fixes error handling logic (mount returns 0/-1, not an errno value, and I at least get EACCES rather than EROFS in the case where the underlying block device is read-only; we should also probably only try again if the ioctl actually succeeded), and adds the missing newline in case where we go around and try again read-only. The test case was "mount -o rw,remount /system" on Android.
2016-02-17Testfile with the 3 different types of "not utf8 output" escaped chars in it.Rob Landley
2016-02-17Add dynamic/static checking to file (printing dynamic linker if found).Rob Landley
2016-02-17Add the sed invocations to convert tabs/spaces and back, plus some tweaks.Rob Landley
2016-02-15Cleanup pass on file.c, and add detection of different ELF architectures.Rob Landley
2016-02-14Add "make list", rename make working->list_working and pending->list_pending,Rob Landley
and filter out commands that aren't nofork but aren't installed either (toyflags 0, I.E. recognized aliases like "-sh" called from login).
2016-02-14Implement file(1).Elliott Hughes
Unlike the POSIX file(1), there's no magic file here, just hard-coded common (non-obsolete) file formats. Personally most of my use of file(1) is as a one-line readelf(1) summarizer, so although I assume a full POSIX file(1) is out of scope (because just the database would likely be larger than all the rest of toybox), a subset that only supports in-use file types actually covers most of the use cases I encounter personally. Also fix peek_be/peek_le.
2016-02-14Fix wc -c optimization.Elliott Hughes
Check the fstat(2) return value rather than read uninitialized memory if it failed, and add a special case for files that claim to be zero-length but aren't (as is common in /proc on Linux).
2016-02-11removed unread assignment in sed.clovelycuppatea
clang scan-build flags up this line as being unread, so clearing from code.
2016-02-10Ignore .singlemake.Rob Landley
2016-02-10Wean scripts/install.c off toys.h so cross compiling less brittle.Rob Landley
2016-02-10Don't include toys.h from config2help.c (so cross-compiling from systems weRob Landley
don't run on is easier), and use HELP_ instead of help_ for macro prefixes to avoid name collisions (such as help_exit() the function).
2016-02-10toybox: tar: Fix support for long namesTom Marshall
Pathnames may be longer than the name field in the header, so use strncpy() instead of xstrncpy() to avoid bailing out. Also add unit tests to ensure proper handling of short and long pathnames. Change-Id: Id025891993746889564b479e5185cf9721b54a55
2016-02-10toybox: tar: Fix tar testsTom Marshall
Don't rely on ordering of readdir for tests. Change-Id: Ice24bb64ce453acb0006e3746677d619db933ab1
2016-02-10main.c: fix non-root usage when installed suid rootPatrick Ohly
When toybox is installed suid root and invoked by a non-root user for commands which do not require root privileges, it drops the root privileges during initialization. However, since commit afba5b8efd the result check of setuid() was inverted such that it aborted on success, making toybox unusuable for non-root users. Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
2016-02-10Add seq -w, suggested by izabera.Rob Landley
2016-02-10Factor out strnstr() since posix hasn't got it, and add a config option forRob Landley
the deeply sad passwd heuristics that don't even check numbers and punctuation.
2016-02-10make wc -c fasterizabera
2016-02-10use unsigned long with factorizabera
2016-02-10Although printf("%.*s", INT_MAX, s) works fine on ubuntu 12.04, it broke since.Rob Landley
2016-02-10implement env -uizabera
2016-02-09Add ulimit.Rob Landley
This isn't a shell builtin, it uses prlimit to target any pid (without -P it defaults to $PPID, so acts like historical ulimit by default).
2016-02-09Fix xpipe. (thinko.)Rob Landley
2016-02-08Add xpipe() to lib.Rob Landley
2016-02-07Dependencies for "make COMMAND"Rob Landley
2016-02-07Add "make ls" and friends targets, with "make working" and "make pending" lists.Rob Landley
2016-02-07Add a warning when building commands out of pending.Rob Landley
2016-02-05Debian unstable is even more pedantic than previous debian.Rob Landley
2016-02-05Another fix from Josh Gao to avoid a null pointer dereference, andRob Landley
minor cleanup of previous commit.
2016-02-05Fix segfault when `find -iname` gets no argument.Josh Gao
2016-02-04Fix -H and -n with -ABC, and add tests.Rob Landley
2016-02-04Merge branch 'master' of ssh://github.com/landley/toyboxRob Landley