OSDN Git Service
Elliott Hughes [Thu, 15 Jan 2015 00:52:07 +0000 (00:52 +0000)]
Merge changes I698a1608,I9d66c41d,I3a4917a5,Id3d633ff,Id0dead30, ...
* changes:
Let chown build standalone.
sed bugfix: N or n at end of script would save the terminating NULL as the resume position, so the script would restart from beginning.
sed s/// can have line continuations in the replacement part, with or without a \ escaping the newline.
Promote printf.
One more bugfix for printf.c, with test suite entry. (Make %-3d etc work.)
Cleanup pass on printf.
More half-finished cleanup of printf.c, and more test suite entries.
Since "printf" is a shell builtin, printf.test wasn't actually testing anything.
More printf cleanup, and test suite entries.
Elliott Hughes [Thu, 15 Jan 2015 00:51:02 +0000 (00:51 +0000)]
Merge changes Ia8df7446,I77c8d1a7,Iaad492fd,I87fd25f2,I4f534572, ...
* changes:
Fix sed backslash parsing in square bracket pattern sections.
Another cleanup pass on printf.
Move fflush() checking to xexit() and have exit paths in main() call that.
Cleanup pass on printf.
Need to update install.c for the changed OLDTOY() argument list.
Tweak status.html
Switch a lot of strncpy() calls to xstrncpy().
strncpy(optptr, hname, strlen(hname)) is really just strcpy().
strtol() doesn't return error indicator for overflow, it just sets errno. So add estrtol() (which clears errno first), and xstrtol() (which error_exit()s on overflow).
Debris from flag handling rewrite: don't allow -^A to actually trigger.
typo fixes
Fix for mix from Isaac Dunham (who can actually test it). (I tweaked the curly brackets.)
Redo option parsing infrastructure so #define FORCE_FLAGS can unzero flag macros for a disabled command (needed when multiple commands share infrastructure with a common set of flags).
When CP_MORE was disabled, the d flag was still in the [-exclusion] list at the end and option parsing fell off the end looking for it (segfault) if DEBUG wasn't enabled to check for that.
Elliott Hughes [Thu, 15 Jan 2015 00:50:42 +0000 (00:50 +0000)]
Merge changes Ide699acc,I774c599c,I5c419e37,I7f24174d,I989f453e, ...
* changes:
When you include the posix header libgen.h, glibc #defines basename to some random other symbol name (because gnu) and this screws up nontrivial macro expansions of NEWTOY(basename), so work around it in portability.h.
Link to gmane web archive.
Another random link for the design page.
Fluff out help text.
Promote mix
Cleanup mix.c.
Elliott Hughes [Wed, 14 Jan 2015 23:15:26 +0000 (23:15 +0000)]
Merge "Teach factor to accept whitespace separated arguments (reported by Robert Thompson)."
Elliott Hughes [Wed, 14 Jan 2015 20:26:10 +0000 (12:26 -0800)]
Switch to toybox date, and add hwclock.
Change-Id: I5116713315c2f86d4dfb6beccf0e41b3fb8a24f7
Elliott Hughes [Wed, 14 Jan 2015 19:07:28 +0000 (11:07 -0800)]
Switch to toybox ifconfig.
Change-Id: Ifef0cc12d1edc8ad8647919343035f7966dfc621
Elliott Hughes [Wed, 14 Jan 2015 19:00:47 +0000 (11:00 -0800)]
Switch on toybox inotifyd.
Change-Id: I4c95fd2d383654090b3846ee4aaa44bd35a55e68
Elliott Hughes [Wed, 14 Jan 2015 18:40:22 +0000 (10:40 -0800)]
Switch to toybox cat.
Change-Id: Ic50d784b8782c0d3483c2af26fab72063fed3992
Rob Landley [Wed, 14 Jan 2015 06:31:06 +0000 (00:31 -0600)]
Let chown build standalone.
Elliott Hughes [Wed, 14 Jan 2015 02:45:44 +0000 (18:45 -0800)]
Add sed and tr.
Change-Id: I9749fa432f49980da629b1a12073103bab03ea3d
Elliott Hughes [Wed, 14 Jan 2015 02:08:08 +0000 (18:08 -0800)]
Remove factor and readahead.
Neither is very useful, and readahead doesn't exist on the desktop.
Change-Id: I84e26dd3be2169d64f95ef3af2969b070283e5db
Rob Landley [Tue, 13 Jan 2015 10:28:19 +0000 (04:28 -0600)]
sed bugfix: N or n at end of script would save the terminating NULL as the resume position, so the script would restart from beginning.
Rob Landley [Tue, 13 Jan 2015 09:35:37 +0000 (03:35 -0600)]
sed s/// can have line continuations in the replacement part, with or without a \ escaping the newline.
Rob Landley [Sun, 11 Jan 2015 16:17:58 +0000 (10:17 -0600)]
Promote printf.
Rob Landley [Sun, 11 Jan 2015 16:16:38 +0000 (10:16 -0600)]
One more bugfix for printf.c, with test suite entry. (Make %-3d etc work.)
Rob Landley [Sun, 11 Jan 2015 07:22:36 +0000 (01:22 -0600)]
Cleanup pass on printf.
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.
Rob Landley [Sun, 11 Jan 2015 02:02:21 +0000 (20:02 -0600)]
More half-finished cleanup of printf.c, and more test suite entries.
Rob Landley [Tue, 6 Jan 2015 21:06:51 +0000 (15:06 -0600)]
Since "printf" is a shell builtin, printf.test wasn't actually testing anything.
Rob Landley [Tue, 6 Jan 2015 18:07:20 +0000 (12:07 -0600)]
More printf cleanup, and test suite entries.
Fixes bug introduced last time where toys.optargs was both snapshotted and used
directly and the two fell out of sync.
Rob Landley [Sun, 4 Jan 2015 09:50:52 +0000 (03:50 -0600)]
Fix sed backslash parsing in square bracket pattern sections.
Rob Landley [Sun, 4 Jan 2015 02:31:41 +0000 (20:31 -0600)]
Another cleanup pass on printf.
Rob Landley [Sat, 3 Jan 2015 22:25:36 +0000 (16:25 -0600)]
Move fflush() checking to xexit() and have exit paths in main() call that.
Rob Landley [Sat, 3 Jan 2015 03:28:39 +0000 (21:28 -0600)]
Cleanup pass on printf.
Rob Landley [Fri, 2 Jan 2015 06:44:27 +0000 (00:44 -0600)]
Need to update install.c for the changed OLDTOY() argument list.
Rob Landley [Thu, 1 Jan 2015 23:37:57 +0000 (17:37 -0600)]
Tweak status.html
Rob Landley [Thu, 1 Jan 2015 22:59:35 +0000 (16:59 -0600)]
Switch a lot of strncpy() calls to xstrncpy().
Rob Landley [Thu, 1 Jan 2015 22:49:55 +0000 (16:49 -0600)]
strncpy(optptr, hname, strlen(hname)) is really just strcpy().
Rob Landley [Thu, 1 Jan 2015 22:28:51 +0000 (16:28 -0600)]
strtol() doesn't return error indicator for overflow, it just sets errno. So add estrtol() (which clears errno first), and xstrtol() (which error_exit()s on overflow).
Rob Landley [Thu, 1 Jan 2015 22:19:40 +0000 (16:19 -0600)]
Debris from flag handling rewrite: don't allow -^A to actually trigger.
Elliott Hughes [Thu, 1 Jan 2015 16:58:59 +0000 (10:58 -0600)]
typo fixes
Rob Landley [Thu, 1 Jan 2015 04:38:48 +0000 (22:38 -0600)]
Fix for mix from Isaac Dunham (who can actually test it). (I tweaked the 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.
Rob Landley [Thu, 1 Jan 2015 03:30:59 +0000 (21:30 -0600)]
Redo option parsing infrastructure so #define FORCE_FLAGS can unzero flag 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.
Rob Landley [Thu, 1 Jan 2015 03:23:37 +0000 (21:23 -0600)]
When CP_MORE was disabled, the d flag was still in the [-exclusion] list at the end and option parsing fell off the end looking for it (segfault) if DEBUG wasn't enabled to check for that.
Rob Landley [Wed, 31 Dec 2014 22:22:31 +0000 (16:22 -0600)]
When you include the posix header libgen.h, glibc #defines basename to some random other symbol name (because gnu) and this screws up nontrivial macro expansions of NEWTOY(basename), so work around it in portability.h.
Rob Landley [Tue, 30 Dec 2014 20:49:02 +0000 (14:49 -0600)]
Link to gmane web archive.
Rob Landley [Sun, 28 Dec 2014 20:44:09 +0000 (14:44 -0600)]
Another random link for the design page.
Rob Landley [Sun, 28 Dec 2014 20:38:14 +0000 (14:38 -0600)]
Fluff out help text.
Rob Landley [Sat, 27 Dec 2014 19:52:40 +0000 (13:52 -0600)]
Promote mix
Rob Landley [Sat, 27 Dec 2014 19:52:03 +0000 (13:52 -0600)]
Cleanup mix.c.
Rob Landley [Wed, 24 Dec 2014 22:13:08 +0000 (16:13 -0600)]
Teach factor to accept whitespace separated arguments (reported by Robert Thompson).
(The diff looks bigger than it is because of reindenting.)
Elliott Hughes [Wed, 24 Dec 2014 19:29:44 +0000 (11:29 -0800)]
Switch to toybox getenforce/setenforce.
Change-Id: I1f11c231633dd443c13d099c27b0823b3082ed58
Elliott Hughes [Wed, 24 Dec 2014 19:11:39 +0000 (19:11 +0000)]
Merge "Regenerate generated files after upstream sync."
Elliott Hughes [Wed, 24 Dec 2014 19:09:37 +0000 (11:09 -0800)]
Merge remote-tracking branch 'toybox/master' into HEAD
Rob Landley [Mon, 22 Dec 2014 05:17:06 +0000 (23:17 -0600)]
Another sed bug. (The e2fsprogs build uses multiple line continuations on the same command.)
Rob Landley [Sun, 21 Dec 2014 07:54:54 +0000 (01:54 -0600)]
Promote sed to posix.
Elliott Hughes [Wed, 24 Dec 2014 19:06:26 +0000 (19:06 +0000)]
Merge changes I32cd2b77,Ia136fa57,I95b76828
* changes:
sed: implement 'l'
Add tizen section to roadmap.
More sed bugs.
Elliott Hughes [Wed, 24 Dec 2014 18:59:08 +0000 (10:59 -0800)]
Regenerate generated files after upstream sync.
Change-Id: Ic66d724f729605eda62932bd1c2aa5d1c41aee35
Elliott Hughes [Wed, 24 Dec 2014 01:20:24 +0000 (19:20 -0600)]
getenforce and setenforce
two more easy SELinux commands:
Elliott Hughes [Wed, 24 Dec 2014 01:17:13 +0000 (19:17 -0600)]
those of us who need to check in generated files find that 'tr' and
'traceroute' keep swapping places. self-inflicted, yes, but not much i
can do about it :-(
Rob Landley [Tue, 23 Dec 2014 19:29:47 +0000 (13:29 -0600)]
Merge catv back into cat as discussed on the list. Add comments about infrastructure upgrades needed to restore separate catv option.
Elliott Hughes [Tue, 23 Dec 2014 17:12:18 +0000 (09:12 -0800)]
Switch to toybox netstat.
Change-Id: Ic147e275170600e112f77f8a4052d447c84b70d9
Rob Landley [Mon, 22 Dec 2014 23:04:47 +0000 (17:04 -0600)]
Allocate space for null terminator.
Rob Landley [Mon, 22 Dec 2014 19:45:35 +0000 (13:45 -0600)]
sed 'r' didn't work right.
Rob Landley [Mon, 22 Dec 2014 05:17:06 +0000 (23:17 -0600)]
Another sed bug. (The e2fsprogs build uses multiple line continuations on the same command.)
Elliott Hughes [Mon, 22 Dec 2014 00:38:24 +0000 (16:38 -0800)]
Remove uudecode/uuencode.
What were they, grandpa? They're not on a base Ubuntu install, so POSIX
or no, they probably don't make much sense any more.
Change-Id: I61d202e03dc87daef45da7797a7daccd55d366f7
Rob Landley [Sun, 21 Dec 2014 07:54:54 +0000 (01:54 -0600)]
Promote sed to posix.
Rob Landley [Sun, 21 Dec 2014 05:28:30 +0000 (23:28 -0600)]
sed: implement 'l'
Rob Landley [Sat, 20 Dec 2014 20:58:03 +0000 (14:58 -0600)]
Add tizen section to roadmap.
Rob Landley [Sat, 20 Dec 2014 03:17:49 +0000 (21:17 -0600)]
More sed bugs.
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.
Elliott Hughes [Fri, 19 Dec 2014 04:45:11 +0000 (20:45 -0800)]
Rebuild configuration after latest sync.
Change-Id: I8be56e1b83348b83da4670c1a32c1c92c0f748f2
Elliott Hughes [Fri, 19 Dec 2014 04:32:40 +0000 (20:32 -0800)]
Merge remote-tracking branch 'toybox/master' into HEAD
Elliott Hughes [Fri, 19 Dec 2014 01:55:47 +0000 (17:55 -0800)]
Regenerate the configuration after the upstream sync.
Change-Id: I4a26da4dd9f27de167960c9afa59753dbfac7a19
Elliott Hughes [Fri, 19 Dec 2014 01:53:36 +0000 (01:53 +0000)]
Merge "Fix yet another sed bug."
Elliott Hughes [Fri, 19 Dec 2014 01:53:30 +0000 (01:53 +0000)]
Merge "Make sed a\ line continuations work properly for different pattern input modes."
Elliott Hughes [Fri, 19 Dec 2014 01:53:26 +0000 (01:53 +0000)]
Merge "Fix bug in sed y/// where bytes in target but not in source were replaced by zeroes (nul terminator overwritten)."
Elliott Hughes [Fri, 19 Dec 2014 01:53:21 +0000 (01:53 +0000)]
Merge "Last sed bugfix broke 'b', fix it."
Elliott Hughes [Fri, 19 Dec 2014 01:53:16 +0000 (01:53 +0000)]
Merge "Leftover variable from factoring out base64_init() caused an unused variable warning."
Elliott Hughes [Fri, 19 Dec 2014 01:53:11 +0000 (01:53 +0000)]
Merge "Oops. xfork() moved to portability.c and the config2help.c build wasn't including that. (Worked until I did a "make clean".)"
Elliott Hughes [Fri, 19 Dec 2014 01:53:06 +0000 (01:53 +0000)]
Merge "Forgot to check in a header file for base64."
Elliott Hughes [Fri, 19 Dec 2014 01:52:57 +0000 (01:52 +0000)]
Merge "Add "make help" entry for "make change"."
Elliott Hughes [Fri, 19 Dec 2014 00:47:38 +0000 (00:47 +0000)]
Merge changes I0517eb7d,I87fbe12d
* changes:
Add base64.
Remove more strncpy() calls.
Rob Landley [Thu, 18 Dec 2014 17:13:35 +0000 (11:13 -0600)]
Decouple cp and mv so mv uses its own --help text.
MV still requires CP enabled until the flag generation logic gets updated.
Rob Landley [Thu, 18 Dec 2014 17:05:06 +0000 (11:05 -0600)]
Give fstype its own config symbol (separate from blkid), and fix blkid not using more accurate ext3/ext4 filesystem sub-type.
Elliott Hughes [Wed, 17 Dec 2014 05:31:36 +0000 (21:31 -0800)]
Stop building 'count' and 'oneit'.
count and oneit aren't things packaged by Debian.
Change-Id: Ic0e3bde529e0345f4f4acd0cd4e8af4da061e692
Elliott Hughes [Wed, 17 Dec 2014 04:18:05 +0000 (20:18 -0800)]
Build various 'pending' toybox commands that are in toolbox.
The stuff in pending isn't built by default, so anything we want from
there we have to explicitly choose. Stuff that's already in toolbox
seems like stuff we should be building so we can try it out.
Change-Id: Iabd069fbbfb2805a771958faa2ef2f6d5f0cb333
Elliott Hughes [Wed, 17 Dec 2014 03:18:43 +0000 (19:18 -0800)]
Switch to toybox mv.
Change-Id: I2f2de24cd243e0d4f478b0d0b542f7ddbc53f0b4
Elliott Hughes [Wed, 17 Dec 2014 00:22:32 +0000 (16:22 -0800)]
Switch to toybox rm.
Change-Id: Ice0d3013421df1d2ceb57d01249fac261ae7d914
Elliott Hughes [Wed, 17 Dec 2014 00:15:47 +0000 (16:15 -0800)]
Switch to toybox cp.
Change-Id: I643ca5eb265a6507e19b35410f216777a00e4e31
Elliott Hughes [Tue, 16 Dec 2014 23:48:40 +0000 (15:48 -0800)]
Stop building obsolete cpio, killall5, link, and unlink.
Change-Id: Id3190e1f793ebecd18fbe950c49f83ab1cccc4f3
Elliott Hughes [Tue, 16 Dec 2014 23:26:53 +0000 (15:26 -0800)]
Switch rmdir to toybox.
Change-Id: I0296534cf471bc8b56d1baed63417c93974dc0e4
Elliott Hughes [Tue, 16 Dec 2014 23:17:17 +0000 (15:17 -0800)]
Switch to toybox mkdir.
Change-Id: I79b5f135fff59053f66c0341b7194138fbd171aa
Elliott Hughes [Tue, 16 Dec 2014 17:14:47 +0000 (09:14 -0800)]
Switch to toybox chcon.
Change-Id: I9b2fff811c0a1c2a40e1a23a09e25e758661ed1d
Rob Landley [Mon, 15 Dec 2014 09:34:55 +0000 (03:34 -0600)]
Fix yet another sed bug.
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.
Rob Landley [Sun, 14 Dec 2014 19:51:28 +0000 (13:51 -0600)]
Make sed a\ line continuations work properly for different pattern input modes.
Rob Landley [Sun, 14 Dec 2014 00:35:11 +0000 (18:35 -0600)]
Fix bug in sed y/// where bytes in target but not in source were replaced by zeroes (nul terminator overwritten).
Rob Landley [Sat, 13 Dec 2014 18:27:51 +0000 (12:27 -0600)]
Last sed bugfix broke 'b', fix it.
Rob Landley [Sat, 13 Dec 2014 18:12:14 +0000 (12:12 -0600)]
Leftover variable from factoring out base64_init() caused an unused variable warning.
Rob Landley [Sat, 13 Dec 2014 18:09:25 +0000 (12:09 -0600)]
Oops. xfork() moved to portability.c and the config2help.c build wasn't including that. (Worked until I did a "make clean".)
Rob Landley [Sat, 13 Dec 2014 17:59:37 +0000 (11:59 -0600)]
Forgot to check in a header file for base64.
Rob Landley [Sat, 13 Dec 2014 17:59:10 +0000 (11:59 -0600)]
Add "make help" entry for "make change".
Rob Landley [Sat, 13 Dec 2014 17:58:08 +0000 (11:58 -0600)]
Add base64.
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.
Rob Landley [Sat, 13 Dec 2014 17:56:41 +0000 (11:56 -0600)]
Remove more strncpy() calls.
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().
Elliott Hughes [Sat, 13 Dec 2014 00:09:26 +0000 (16:09 -0800)]
Merge remote-tracking branch 'toybox/master' into HEAD
Elliott Hughes [Fri, 12 Dec 2014 02:34:09 +0000 (18:34 -0800)]
Switch to toybox mknod.
Change-Id: Ica6df62b5658736f1cd5e884a1c97f0cd72fb53d
Elliott Hughes [Fri, 12 Dec 2014 02:17:28 +0000 (20:17 -0600)]
here's a patch that should let us replace toolbox's chcon.
(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?
Elliott Hughes [Fri, 12 Dec 2014 01:05:54 +0000 (17:05 -0800)]
Add more(1).
Change-Id: I7c4707e110b43741486d988fd3600b0a434f5a8b
Elliott Hughes [Thu, 11 Dec 2014 20:12:59 +0000 (12:12 -0800)]
Switch to toybox chmod.
Change-Id: I6b06969636eac3c915ad271febe06d93bb64a35b
Rob Landley [Thu, 11 Dec 2014 00:59:22 +0000 (18:59 -0600)]
Make unescape_delimited_string() copy the string so error reporting isn't so messed up.
Elliott Hughes [Thu, 11 Dec 2014 00:23:36 +0000 (16:23 -0800)]
Merge remote-tracking branch 'toybox/master' into HEAD
Rob Landley [Wed, 10 Dec 2014 23:59:00 +0000 (17:59 -0600)]
Fix some sed bugs and improve error reporting.
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).