Age | Commit message (Collapse) | Author |
|
(The sigatexit() handler list code now calls the handlers on the normal
exit path, so _exit(1) from the handler is wrong; exit_signal() modifies
toys.exitval if necessary.)
|
|
|
|
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.
|
|
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).
|
|
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.
|
|
the deeply sad passwd heuristics that don't even check numbers and punctuation.
|
|
|
|
|
|
Also, I forgot to check in uuid_show() last time.
|
|
|
|
Some things are worse when you remove the 'p'.
|
|
Commit 4b4ab6a50998 broke loopfiles' handling of "-".
This broke the existing cat tests, so no new test is necessary here.
|
|
checking, and fix up format checking complaints.
Added out(type, value) function to stat to avoid a zillion printf typecasts.
|
|
|
|
and add test_scankey.
|
|
Change readfileat() to pass back length of read.
|
|
|
|
As with ls, it doesn't seem like -Z should be guarded behind LSM
availability. On a non-SELinux system, the label is always "unconfined".
|
|
|
|
|
|
This fixes the build break, the change to yesno() prototype accidentally got
checked in last commit. (Oops, sorry.)
|
|
and update the tests.
|
|
Rounds correctly via brute force, displayed digits are decimal even when
working with powers of 2, shows at most 3 significant (decimal) digits.
(So no "1023M" nonsense, that's 1.0G.)
|
|
looks like. dd uses "7 MB" where du uses "7M", for example. this patch
adds flags, similar to the BSD humanize_number. most callers will pass 0.
|
|
|
|
|
|
itself on some inputs. (Which makes killall really impolite. Bug report
from Nicholas Noury via Elliott Hughes.)
|
|
|
|
|
|
|
|
alphasort), add compile-time probe for config symbol TOYBOX_ON_ANDROID.
|
|
The shell's pseudo-variable is called LINES. This is true of at least
bash and mksh.
|
|
|
|
(137 returned "137 KB".)
|
|
|
|
add estrtol() (which clears errno first), and xstrtol() (which error_exit()s on overflow).
|
|
|
|
The tizen guys wanted this. Yeah, I know there's base64 code in
uuencode/uudecode, but that this has -i, input lines aren't of fixed length,
encode/decode are in same file, there's no prefix/suffix code, it always
writes to stdout... Eliminating the code duplication wouldn't be worth
the if/else I'd have to add, so I just did a new one.
Factored out the base64 table init into lib.c though: that was worth sharing.
|
|
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().
|
|
attempts to read from stdout instead of stdin for "-" or no arguments.
|
|
|
|
|
|
pass those extra bits through.
|
|
|
|
|
|
|
|
|
|
toys.signalfd if set.
|
|
du use it, move it from lib/pending.c to lib.c.
|
|
free can cause a crash, if the buffer passed by user of function is not malloc'ed one.
names_to_pid() is one usecase example here.
|