aboutsummaryrefslogtreecommitdiff
path: root/toys/pending
AgeCommit message (Collapse)Author
2016-08-20Clean up setfattr.Rob Landley
2016-08-06Inline setup_inout(), test ftruncate() return value, move gettimeofday() beforeRob Landley
seek so seek time is included in total.
2016-08-04Make xopen() skip stdin/stdout/stderr, add xopen_stdio() if you want stdout,Rob Landley
add xopenro() that takes one argument and understands "-" means stdin, and switch over lots of users.
2016-07-18Add getfattr(1) and setfattr(1).Elliott Hughes
Plus basic tests.
2016-07-08dd improvements.Elliott Hughes
Support hex (requested by users). Support status=noxfer and status=none (requested by users). Fix status output. Clarify large numbers in --help output. Use O_TRUNC rather than ftruncate unless we're also seeking. New tests. Also partial cleanup (reuse of existing code, removal of non-GLOBALS globals, and merge dd_main and do_dd).
2016-07-03Promote file.Rob Landley
2016-07-03Improve file(1)'s ELF support.Elliott Hughes
Read any PT_NOTE sections to look for NT_GNU_BUILD_ID or Android API level notes. I deliberately didn't NT_GNU_ABI_TAG because it's noisy -- every Linux executable has one -- but not something most command-line users will have any use for. (And you can ask readelf(1) anyway.) Also read the section headers to implement "stripped"/"not stripped". This patch removes "uses %d libs" because it was actually just counting dynamic sections in the ELF file, and there are only 0 or 1 of those in a valid ELF flie. (If you really want this functionality, you have to *parse* the dynamic section looking for the DT_NEEDED entries. But that's more of a job for readelf(1) than file(1).)
2016-07-03Promote netsat, and move ifconfig, netcat, and rfkill to new toys/net directory.Rob Landley
2016-07-03More netstat cleanup (inline display_data)Rob Landley
2016-07-02Next round of netstat cleanup.Rob Landley
2016-06-19Next round of diffstat cleanup.Rob Landley
2016-06-12Lots of netstat cleanup, including a rewrite of the unix domain socket output.Rob Landley
(Ubuntu's netstat is left justifying the inode field, and they're wrong.)
2016-06-12Finish switching to dev_major/dev_minor.Elliott Hughes
7ca5dc4232b9ac5ee5cd25c8b5b33a58904cd251 didn't switch all callers over to the new functions.
2016-06-10Missing parentheses. (Oops.)Rob Landley
2016-06-10Fix trailing whitespace bug in netstat.Elliott Hughes
Spotted while trying to diff netstat -nt against toybox netstat -nt.
2016-06-10xreadlink() only exits for memory allocation, it returns 0 if file not found.Rob Landley
(I forget who reported this bug, wasn't me.)
2016-04-23Fix more to not append an extra newline.Elliott Hughes
More's sigatexit handler needs to distinguish between normal exit and exit due to receipt of a signal. Change tty_sigreset to look at the signal number too, so that pressing 'q' to exit top doesn't cause its exit status to be 128.
2016-04-23Fix more to a non-tty.Elliott Hughes
And add a test.
2016-04-17Dust off toysh, remove ancient config debris, add start of prompt logic.Rob Landley
2016-04-14Fix a buffer overflow in diff -r.Andy Chu
We were doing two 32-byte memset()s instead of two 16-byte memset()s. 'dir' referred to the instance (array of 2) and not the struct type. Add some test coverage for diff, including a case that hit this bug. The bug was found by running cp.test under AddressSanitizer, since it happens to use diff.
2016-04-08Redefining basename_r to mean something random seems popular (bionic and freebsdRob Landley
both did it) so use getbasename instead.
2016-03-20Posix requires "" to be false, and 00 should be false, and -0 should be false.Rob Landley
Fix memory leaks in regex. Simplify regex check (if we matched, subexpression had to match). Don't exit() from a command, set exitval and return.
2016-03-19Make lsof 10x faster by caching /proc/net socket info.Elliott Hughes
I deliberately didn't do this first time round because for me our lsof is already 10x faster than traditional lsof, and caching means we potentially give less information about a socket that's created while we're running. It turns out that traditional lsof caches anyway, so I guess nobody cares. This also fixes a mistake where lsof used CFG_FREE instead of CFG_TOYBOX_FREE.
2016-03-17expr cleanup: simplify get_str() and free returned allocations.Rob Landley
2016-03-16expr cleanup: traverse optargs with tok instead of incrementing optargs andRob Landley
copying itinto a second variable. Also add error message for empty ( )
2016-03-16Move whitespace and curly brackets around, move reference URLs to top of file,Rob Landley
eliminate syntax_error() function (just call error_exit() directly), eliminate advance() wrapper, pipe expected error messages in test to /dev/null
2016-03-16Fix type coercion bugs in expr.Andy Chu
All tests pass now; this fixes the 2 remaining failures, including a segfault. The structure of the code has changed a lot -- instead of having a tiny function per operator, we have eval_op() which does common type coercion and then evaluates the operator. I tried writing it a couple different ways, and this was the cleanest. The OPS table now contains the operator string, precedence level, signature for type coercion, and operator ID.
2016-03-16Fix the operator precedence in expr.Andy Chu
expr now uses the precedence table specified by POSIX, implemented using the "precedence climbing" algorithm. See the references at the top of eval_expr(). This fixes 3 of 4 failing tests. I also added more tests for correct behavior and for syntax errors. This includes a new test exposing a segfault, related to type coercion.
2016-03-08Add depends on TOYBOX_FORK for various commands that need nommu conversion.Rob Landley
(This should fix allyesconfig.)
2016-03-07Cleanup pass on the dirtree infrastructure, in preparation for making rm -rRob Landley
handle infinite depth. Fix docs, tweak dirtree_handle_callback() semantics, remove dirtree_start() and don't export dirtree_handle_callback(), instead offer dirtree_flagread(). (dirtree_read() is a wrapper around dirtree_flagread passing 0 for flags.)
2016-03-06wget: clean upLipi Lee
- shorten error messages - replace mk_rq with sprintf - remove struct and defines - change unsigned int to unsigned
2016-03-06Another pass at file.c: move posix-required "executable" to front of output,Rob Landley
next few fields in the order the other implementation outputs, fewer commas, fix a big where big endian executable type wasn't detected right, and fix the filehandle leak.
2016-03-02Fix file for Java class files, improve script detection, and add tests.Elliott Hughes
2016-03-02More minor cleanup (inline a function, simplify name of another).Rob Landley
2016-03-02Minor cleanup.Rob Landley
2016-03-02For years the man pages have said to #include <sys/types.h> to getRob Landley
major/minor/makedev, but glibc has vowed to break existing programs (https://sourceware.org/ml/libc-alpha/2015-11/msg00253.html) and replace it with _another_ non-standard header (not in posix or lsb), so let's just add functions to lib/ that do the transform ourselves.
2016-03-01Use the correct types for recvfrom.George Burgess IV
The clang FORITFY implementation doesn't like pointer signedness mismatch. "What mismatch?", you say. "The historical bug in LP32 Android that left it with a signed socklen_t".
2016-02-29do_regular_file() prints output line, don't fall through to print default.Rob Landley
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-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-17Add dynamic/static checking to file (printing dynamic linker if found).Rob Landley
2016-02-15Cleanup pass on file.c, and add detection of different ELF architectures.Rob Landley
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-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-08Add xpipe() to lib.Rob Landley
2016-01-25Fix compiler warnings in traceroute.Elliott Hughes
If we're fixing warnings in pending...