aboutsummaryrefslogtreecommitdiff
path: root/toys
AgeCommit message (Collapse)Author
2015-02-07Make toy_exec() check if argc is in optargs and deal with it there so we ↵Rob Landley
don't need a separate xexec_optargs().
2015-02-07Merge unshare and nsenter (promoting and cleaning up nsenter).Rob Landley
Needs more testing, don't have a test environment set up for this yet...
2015-02-06In rm, init using to AT_REMOVEDIR in the dir case earlier.Rob Landley
(If you had a chmod 000 directory and did rm -r on it without -f, after the prompt it would complain it was a directory.)
2015-02-06Alright, the Android guys agree with the musl guys: ↵Rob Landley
faccessat(AT_SYMLINK_NOFOLLOW) is not supported.
2015-01-25Commit 1061 said "this gets expand off my to-review list". Remove it from ↵Rob Landley
the list.
2015-01-25Cleanup mountpoint and remove it from the pending README.Rob Landley
2015-01-22bootchartd: Removing wrong free call to non-malloc'ed string.Luis Felipe Strano Moraes
2015-01-22Fix sed s//\[newline]/ line continuations.Rob Landley
The problem was that readline() was returning a newline at the end of each string, which wasn't getting stripped in the parser and thus \ wasn't at the end of a line for -f, it was escaping a literal newline, so the continuation logic didn't trigger. Remove some redundant null checks while we're at it, and don't bother terminating a string we don't return (yes we leak memory in an error path, but it's about to error_exit() anyway).
2015-01-20fix hwclock's rtc selectionElliott Hughes
For systems using /dev/rtcN, /dev/rtc0 isn't necessarily the RTC that's used to provide the system time at boot time. We need to search for the RTC whose /sys/class/rtc/rtcN/hctosys contains "1".
2015-01-20fix typo in printfElliott Hughes
2015-01-18Lift the basename/libgen.h shenanigans back out of portability.c and make it ↵Rob Landley
a static inline in portability.h, and prototype dirname() while we're at it.
2015-01-16AOSP master has <pty.h> and builds netcat/nc.Elliott Hughes
2015-01-16id.c #ifdefectomy. (ifdefs belong in headers, not in C code.)Rob Landley
2015-01-16This patch adds a TOYBOX_SELINUX configuration option to control bothElliott Hughes
the SELinux commands (such as chcon) and the SELinux-specific options to regular commands (such as ls -Z). This lets us #include <selinux/selinux.h> in portability.h. I've also fixed chcon to insist on being given the a context argument. This patch also adds -Z to id and fixes id's regular output (-G should be separated by spaces, non-G output should be separated by commas, and you don't want a double comma where the egid is omitted from the list of groups).
2015-01-14Switch netcat to stop parsing command line at first nonoption argument ↵Rob Landley
instead of stopping after -l or -L. Hyejin Kim tried "toyboxd nc nc -p 1234 -l rm mv ps" (which attempted to run "nc rm mv ps") and "toybox nc -l -p 1234" (which attempted to run "-p 1234") and found the behavior confusing. So make it work like xargs, where all netcat options have to come before the start of any child command.
2015-01-14Make touch -d miliseconds work. (Still only 6 digits precision instead of 9, ↵Rob Landley
but it's a start.)
2015-01-14i found a few problems while manually smoke testing toybox chown versus ↵Elliott Hughes
toolbox (NetBSD) chown... new test: and here's the patch to fix "owner:" ":group" and the ":" special case:
2015-01-14Let chown build standalone.Rob Landley
2015-01-13sed bugfix: N or n at end of script would save the terminating NULL as the ↵Rob Landley
resume position, so the script would restart from beginning.
2015-01-13sed s/// can have line continuations in the replacement part, with or ↵Rob Landley
without a \ escaping the newline.
2015-01-11Promote printf.Rob Landley
2015-01-11One more bugfix for printf.c, with test suite entry. (Make %-3d etc work.)Rob Landley
2015-01-11Cleanup pass on printf.Rob Landley
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.
2015-01-10More half-finished cleanup of printf.c, and more test suite entries.Rob Landley
2015-01-06More printf cleanup, and test suite entries.Rob Landley
Fixes bug introduced last time where toys.optargs was both snapshotted and used directly and the two fell out of sync.
2015-01-04Fix sed backslash parsing in square bracket pattern sections.Rob Landley
2015-01-03Another cleanup pass on printf.Rob Landley
2015-01-02Cleanup pass on printf.Rob Landley
2015-01-01Switch a lot of strncpy() calls to xstrncpy().Rob Landley
2015-01-01strncpy(optptr, hname, strlen(hname)) is really just strcpy().Rob Landley
2015-01-01typo fixesElliott Hughes
2014-12-31Fix for mix from Isaac Dunham (who can actually test it). (I tweaked the ↵Rob Landley
curly brackets.) He says: In the channel selection loop, "if (TT.chan)" had been combined with a strcmp; the else conditionals were premised on if (TT.chan) alone. The help text had been only partially updated for a couple option changes.
2014-12-31Redo option parsing infrastructure so #define FORCE_FLAGS can unzero flag ↵Rob Landley
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.
2014-12-31When CP_MORE was disabled, the d flag was still in the [-exclusion] list at ↵Rob Landley
the end and option parsing fell off the end looking for it (segfault) if DEBUG wasn't enabled to check for that.
2014-12-31When you include the posix header libgen.h, glibc #defines basename to some ↵Rob Landley
random other symbol name (because gnu) and this screws up nontrivial macro expansions of NEWTOY(basename), so work around it in portability.h.
2014-12-28Fluff out help text.Rob Landley
2014-12-27Promote mixRob Landley
2014-12-27Cleanup mix.c.Rob Landley
2014-12-24Teach factor to accept whitespace separated arguments (reported by Robert ↵Rob Landley
Thompson). (The diff looks bigger than it is because of reindenting.)
2014-12-23getenforce and setenforceElliott Hughes
two more easy SELinux commands:
2014-12-23Merge catv back into cat as discussed on the list. Add comments about ↵Rob Landley
infrastructure upgrades needed to restore separate catv option.
2014-12-22sed 'r' didn't work right.Rob Landley
2014-12-21Another sed bug. (The e2fsprogs build uses multiple line continuations on ↵Rob Landley
the same command.)
2014-12-21Promote sed to posix.Rob Landley
2014-12-20sed: implement 'l'Rob Landley
2014-12-19More sed bugs.Rob Landley
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.
2014-12-18Decouple cp and mv so mv uses its own --help text.Rob Landley
MV still requires CP enabled until the flag generation logic gets updated.
2014-12-18Give fstype its own config symbol (separate from blkid), and fix blkid not ↵Rob Landley
using more accurate ext3/ext4 filesystem sub-type.
2014-12-15Fix yet another sed bug.Rob Landley
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.
2014-12-14Make sed a\ line continuations work properly for different pattern input modes.Rob Landley