Age | Commit message (Collapse) | Author |
|
|
|
|
|
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().
|
|
xfork() to portability.h and #ifdef based on __uClinux__ (which seems to be the nommu compiler define).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
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.
|
|
|
|
attempts to read from stdout instead of stdin for "-" or no arguments.
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
another command's help.
|
|
(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.
|
|
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.
|
|
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.
|
|
|
|
we want to redirect both, one, or neither of stdin/stdout.
|
|
|
|
|
|
|
|
TOYBOX_UID_USR in the top level Config.
|
|
s _all_ saved command line arguments in GLOBALS(), not just for the command bein
g dropped.
|
|
pass those extra bits through.
|
|
portability.h.patch - it is for O_CLOEXEC, as compiler complained of it.
Makefile.patch - for cleaning generated/*.o files and libopts.dat file
[Fixup to uniq.c from Rob.]
|
|
|
|
|
|
|
|
|
|
open, and add dir->again variable to distinguish second call instead of checking for -1 filehandle.
|
|
it back off.)
This way we're not leaking filehandles to children from things like find -exec.
|
|
|
|
|
|
|
|
Use wcwidth() instead of strlen(), and extend the -q substitution to also
whiteout nonprintable characters that are nonparseable utf8 snippets.
|
|
|
|
|
|
the salt raw, no $ at the beginning).
|
|
|
|
|
|
|