Age | Commit message (Collapse) | Author |
|
Alas, passing a union as the last argument to printf does not appear to work
reliably, and there's no obvious way to manually assemble varargs in a portable
manner. So I have to repeat the printf once for each data type. Oh well.
|
|
|
|
Fixes bug introduced last time where toys.optargs was both snapshotted and used
directly and the two fell out of sync.
|
|
|
|
|
|
|
|
|
|
|
|
macros for a disabled command (needed when multiple commands share infrastructure with a common set of flags).
This means the flag space is no longer packed, but leaves gaps where the zeroes
go. (Actual flag bit positions are the same for all configs.) Since the
option parsing needs to know where the holes are, the OPTSTR values are
now generated as part of flags.h with ascii 1 values for the disabled values.
(So generated/oldflags.h went away.)
This also means that the option string argument for OLDTOY() went away, it now
uses the same arguments as the NEWTOY() it references.
|
|
|
|
|
|
|
|
two more easy SELinux commands:
|
|
|
|
|
|
1) Newline in -e after s/// was eaten as "whitespace before flags"
2) \\ needs to be passed through to regex to avoid "trailing \" error and
"\\n" is not a newline.
|
|
The s/// command would copy the \ of substitutions before deciding what to
do with them (generally overwriting the \ with the new data). When the
substitution was A) at the very end of the new string, B) resolved to nothing,
it could leave a trailing \ that didn't belong there and didn't get overwritten
because the "copy trailing data" part that copies the original string's null
terminator already happened before the \ overwrote it.
The ghostwheel() function restarts regexes after embedded NUL bytes, but
if the string it's passed is _longer_ than the length it's told then it
gets confused (and it means we're off the end of our allocation so segfaults
are likely).
Fix: test for \ first and move the "copy byte" logic into an else case.
|
|
|
|
zeroes (nul terminator overwritten).
|
|
|
|
(it also adds a feature, -R, because toybox makes that so easy.)
you'll probably want fancier configuration here because although the
--as-needed works okay, a typical Ubuntu box will have the .so but not
the .h files. i did consider adding a toys/selinux/ directory, but
given that existing tools like ls and id will want -Z SELinux options,
i wasn't sure whether you'd think it was worth segregating the
SELinux-only toys.
note that this won't help the tizen smack users (and patch for smack
won't help SELinux users). so you might want to think about where
you'd like us to be aiming: #if USE_SELINUX/USE_SMACK in all the
relevant places, or a toys/selinux and a toys/smack (though we'd still
need #if in at least ls and id), or a lib/security.c that concentrates
all the differences into one file?
|
|
messed up.
|
|
A newline after 'b' commands in -e command line patterns was being discarded
as whitespace, a single element regex match on a {} was leaving stale state
for the next line, and giant -e blobs of instructions were saying things
like problem at character 432 (note: nulls inserted for regex processing
aren't always cleaned up, screws up error reporting).
|
|
to stdout.
|
|
standard.
|
|
build break (open(O_CREAT) without permissions).
|
|
|
|
with the one in pending.
|
|
|
|
regex pattern match.
|
|
|
|
anything left in the line, and more tests.
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
implement them yet.
|
|
*tr.c*: It translate, squezze and delete characters.
Supported classes are alpha, alnum, digit, lower, upper
space, blank, puct, cntrl and xdigit.
*crontab.c*: Companion of crond. It maintains crontab files.
|
|
anything interesting yet.
|