Age | Commit message (Collapse) | Author |
|
bionic, glibc, macOS, and musl all have strcasestr
(see http://man7.org/linux/man-pages/man3/strstr.3.html).
macOS (via BSD) has a strnstr that does what strnstr sounds like it
should do by analogy with strnlen and strncpy.
So we at least need to rename strnstr, but it probably makes more sense
just to switch to strcasestr instead.
|
|
The macOS libc headers use `__attribute__((noreturn))` rather than
`__attribute__((__noreturn__))`, so toybox's `noreturn` macro trips them
up. Since we already have a variety of uses of `__attribute__` that
aren't guarded in this way, let's do the same here.
|
|
|
|
|
|
Prior to calling TIOCGWINSZ on stdin/stdout/stderr, check to see if the
file descriptor is a tty. Calling TIOCGWINSZ on a non-tty doesn't make
any sense.
Calling TIOCGWINSZ on a non-tty is mildly problematic for systems like
Android where strict ioctl filtering is in place, and generates SELinux
audit noise.
Strict ioctl filtering for non-filesystem fifo_files (eg pipe() or
pipe2() generated pipes) was enabled in Android in commit
https://android-review.googlesource.com/c/platform/system/sepolicy/+/792599
|
|
|
|
xparsetime() not to need floating point, adjust callers.
|
|
|
|
|
|
|
|
|
|
|
|
xsignal() wraps sigaction() giving control of SA_RESTART behavior and such.
|
|
|
|
Bug: https://github.com/landley/toybox/issues/43
|
|
It's possible that we should just pull setprop back out of toybox to
live with getprop in system/core/, but this lets us build the same toybox
configuration for device and host in AOSP.
(Longer term we'd like to use host bionic, but if we enable this we
can start experimenting on the tobyox side before the bionic side is
finished.)
|
|
cleanup ala fflush(0) after a normal exec() failure.
|
|
/usr/include/unistd.h:626:15: error: conflicting types for 'confstr'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
runtime for ENOSYS.
|
|
|
|
(My apologies for mixing these two unrelated changes up.)
|
|
|
|
Slightly tweaked version of Elliott's patch. We probably only need to do this
for groups (struct group * has a list of users that belong to it, but
struct passwd doesn't, getgrouplist() is separate) but keeping the code of
the two similar in case there's a way to merge them later.
|
|
adjusting existing users.
|
|
LTP uses `top -d 0.1`, which isn't convincingly useful, but general
support for other time units might be useful, and switching to xparsetime
addresses both at once.
Also fix 3169d948c049664bcf7216d4c4ae751881099d3e where I mistakenly
treated `rev` and `toys.optflags&FLAG_b` as interchangeable. (Without
this second fix, `top -b` looks fine but `top` is broken!)
Also fix xparsetime to reject input such as "monkey" or "1monkey".
|
|
Reuse create_uuid, but make it match the current RFC.
|
|
|
|
|
|
Note: ubuntu will show -m through a file, this treat that as error.
|
|
|
|
|
|
|
|
|
|
|
|
clang is fine with the noreturn nature of error_exit, but only if we don't
`if (false)` it out for non-debug builds.
lib/args.c:304:18: error: variable 'temp' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
} else if (CFG_TOYBOX_FLOAT && new->type == '.') {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
external/toybox/generated/config.h:11:26: note: expanded from macro 'CFG_TOYBOX_FLOAT'
^
external/toybox/lib/args.c:308:19: note: uninitialized use occurs here
options = --temp;
^~~~
external/toybox/lib/args.c:304:14: note: remove the 'if' if its condition is always true
} else if (CFG_TOYBOX_FLOAT && new->type == '.') {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
external/toybox/lib/args.c:255:15: note: initialize the variable 'temp' to silence this warning
char *temp;
^
= NULL
|
|
Found by the compiler, not me:
lib/lib.c:1053:30: warning: 'st2.st_dev' may be used uninitialized in this function [-Wmaybe-uninitialized]
if (st1.st_dev != st2.st_dev || st1.st_ino != st2.st_ino) continue;
~~~^~~~~~~
|
|
|
|
|
|
If we have a 15-byte name, we don't know whether comm actually matches
or is a truncated form of a longer name that has a common prefix.
For example, with "this-is-a-very-long-name-that-is-too-long", we shouldn't
match "this-is-a-very-" (but the old code would).
The cmdline code was also broken on Android because it used basename(3)
rather than getbasename. This doesn't affect glibc because there's a
workaround in portability.h to ensure that we get the non-POSIX basename(3)
with glibc but then a non-glibc section that ensures everyone else gets
POSIX basename(3). That should probably be removed (and maybe `basename`
poisoned) to prevent similar mistakes in future.
Bug: http://b/73123244
|
|
Requires echo 0 $((1<<30)) > /proc/sys/net/ipv4/ping_group_range (as root)
|