platform/upstream/toybox.git
9 years agoCleanup mix.c.
Rob Landley [Sat, 27 Dec 2014 19:52:03 +0000 (13:52 -0600)]
Cleanup mix.c.

9 years agoTeach factor to accept whitespace separated arguments (reported by Robert Thompson).
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.)

9 years agogetenforce and setenforce
Elliott Hughes [Wed, 24 Dec 2014 01:20:24 +0000 (19:20 -0600)]
getenforce and setenforce

two more easy SELinux commands:

9 years agothose of us who need to check in generated files find that 'tr' and
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 :-(

9 years agoMerge catv back into cat as discussed on the list. Add comments about infrastructure...
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.

9 years agoAllocate space for null terminator.
Rob Landley [Mon, 22 Dec 2014 23:04:47 +0000 (17:04 -0600)]
Allocate space for null terminator.

9 years agosed 'r' didn't work right.
Rob Landley [Mon, 22 Dec 2014 19:45:35 +0000 (13:45 -0600)]
sed 'r' didn't work right.

9 years agoAnother sed bug. (The e2fsprogs build uses multiple line continuations on the same...
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.)

9 years agoPromote sed to posix.
Rob Landley [Sun, 21 Dec 2014 07:54:54 +0000 (01:54 -0600)]
Promote sed to posix.

9 years agosed: implement 'l'
Rob Landley [Sun, 21 Dec 2014 05:28:30 +0000 (23:28 -0600)]
sed: implement 'l'

9 years agoAdd tizen section to roadmap.
Rob Landley [Sat, 20 Dec 2014 20:58:03 +0000 (14:58 -0600)]
Add tizen section to roadmap.

9 years agoMore sed bugs.
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.

9 years agoDecouple cp and mv so mv uses its own --help text.
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.

9 years agoGive fstype its own config symbol (separate from blkid), and fix blkid not using...
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.

9 years agoFix yet another sed bug.
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.

9 years agoMake sed a\ line continuations work properly for different pattern input modes.
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.

9 years agoFix bug in sed y/// where bytes in target but not in source were replaced by zeroes...
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).

9 years agoLast sed bugfix broke 'b', fix it.
Rob Landley [Sat, 13 Dec 2014 18:27:51 +0000 (12:27 -0600)]
Last sed bugfix broke 'b', fix it.

9 years agoLeftover variable from factoring out base64_init() caused an unused variable warning.
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.

9 years agoOops. xfork() moved to portability.c and the config2help.c build wasn't including...
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".)

9 years agoForgot to check in a header file for base64.
Rob Landley [Sat, 13 Dec 2014 17:59:37 +0000 (11:59 -0600)]
Forgot to check in a header file for base64.

9 years agoAdd "make help" entry for "make change".
Rob Landley [Sat, 13 Dec 2014 17:59:10 +0000 (11:59 -0600)]
Add "make help" entry for "make change".

9 years agoAdd base64.
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.

9 years agoRemove more strncpy() calls.
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().

9 years agohere's a patch that should let us replace toolbox's chcon.
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?

9 years agoMake unescape_delimited_string() copy the string so error reporting isn't so messed up.
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.

9 years agoFix some sed bugs and improve error reporting.
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).

9 years agoWork with buildroot's extensively patched uClibc, and for nommu support move xfork...
Rob Landley [Fri, 5 Dec 2014 03:46:59 +0000 (21:46 -0600)]
Work with buildroot's extensively patched uClibc, and for nommu support move xfork() to portability.h and #ifdef based on __uClinux__ (which seems to be the nommu compiler define).

9 years agoImplement xstrncat() and fix xstrndup().
Rob Landley [Fri, 5 Dec 2014 03:41:12 +0000 (21:41 -0600)]
Implement xstrncat() and fix xstrndup().

9 years agoAdd shred.
Rob Landley [Thu, 4 Dec 2014 22:42:01 +0000 (16:42 -0600)]
Add shred.

9 years agoMore gzip stuff: now creates -0 compression files (store only), and does so to stdout.
Rob Landley [Wed, 3 Dec 2014 19:09:15 +0000 (13:09 -0600)]
More gzip stuff: now creates -0 compression files (store only), and does so to stdout.

9 years agoFix bug pointed out by Elliott Hughes ("vmstat 1" should repeat endlessly), and remov...
Rob Landley [Tue, 2 Dec 2014 22:02:50 +0000 (16:02 -0600)]
Fix bug pointed out by Elliott Hughes ("vmstat 1" should repeat endlessly), and remove final delay (after all output) for "vmstat 2 3" case.

9 years agoNote posix mailing list posting correcting a bug in the web version of the standard.
Rob Landley [Tue, 2 Dec 2014 19:00:08 +0000 (13:00 -0600)]
Note posix mailing list posting correcting a bug in the web version of the standard.

9 years agoDon't mount a filesystem over an existing one with the same /dev and /dir.
Rob Landley [Tue, 2 Dec 2014 09:17:34 +0000 (03:17 -0600)]
Don't mount a filesystem over an existing one with the same /dev and /dir.

The OS mostly catches this for block devices, but calling "mount -a" twice
shouldn't overmount tmpfs entries with new tmpfs instances. (This needs a test
suite entry, and the test suite needs a root context to run in...)

9 years agoSwitching on fortify was not kind to the pending directory. Fix the actual build...
Rob Landley [Tue, 2 Dec 2014 09:12:58 +0000 (03:12 -0600)]
Switching on fortify was not kind to the pending directory. Fix the actual build break (open(O_CREAT) without permissions).

9 years agoStart of deflate compress-side code, mostly refactoring and stubs so far.
Rob Landley [Tue, 2 Dec 2014 09:05:01 +0000 (03:05 -0600)]
Start of deflate compress-side code, mostly refactoring and stubs so far.

9 years agoAshwini Sharma pointed out that "mkdir sub; ln -s . sub/up; du -L sub" shouldn't...
Rob Landley [Mon, 1 Dec 2014 18:52:55 +0000 (12:52 -0600)]
Ashwini Sharma pointed out that "mkdir sub; ln -s . sub/up; du -L sub" shouldn't loop endlessly.

9 years agoRefactor expr and add another test entry that works with TEST_HOST=1 but not with...
Rob Landley [Mon, 1 Dec 2014 09:15:25 +0000 (03:15 -0600)]
Refactor expr and add another test entry that works with TEST_HOST=1 but not with the one in pending.

9 years agoTests for operator priority groupings.
Rob Landley [Sun, 30 Nov 2014 20:10:36 +0000 (14:10 -0600)]
Tests for operator priority groupings.

9 years agoRemove the strncpy from mountpoint, and make a lot of other changes while I'm here...
Rob Landley [Sun, 30 Nov 2014 17:05:39 +0000 (11:05 -0600)]
Remove the strncpy from mountpoint, and make a lot of other changes while I'm here (to be described on the mailing list).

9 years agoThe "re-exec to regain root permissions" logic broke the error message when calling...
Rob Landley [Sun, 30 Nov 2014 03:11:34 +0000 (21:11 -0600)]
The "re-exec to regain root permissions" logic broke the error message when calling root-only commands through the multiplexer.

It would say "no such command" when it should say "not root".

9 years agoMinor whitespace cleanups.
Rob Landley [Sun, 30 Nov 2014 01:07:08 +0000 (19:07 -0600)]
Minor whitespace cleanups.

9 years agoexpr.c: Added '==' sign into list of operations. Also added support for regex pattern...
Ashwini Sharma [Sun, 30 Nov 2014 00:38:05 +0000 (18:38 -0600)]
expr.c: Added '==' sign into list of operations. Also added support for regex pattern match.

9 years agoImprove error reporting in parallel build. (On error, wait for all children to finish...
Rob Landley [Fri, 28 Nov 2014 23:30:46 +0000 (17:30 -0600)]
Improve error reporting in parallel build. (On error, wait for all children to finish before exiting.)

9 years agoMake sendfile use libbuf.
Rob Landley [Fri, 28 Nov 2014 22:57:45 +0000 (16:57 -0600)]
Make sendfile use libbuf.

9 years agoTiny in-passing cleanups to more.c.
Rob Landley [Fri, 28 Nov 2014 22:56:53 +0000 (16:56 -0600)]
Tiny in-passing cleanups to more.c.

9 years agoCheck in most recent release notes.
Rob Landley [Fri, 28 Nov 2014 22:53:59 +0000 (16:53 -0600)]
Check in most recent release notes.

9 years agoWhen running a test, the diff is always an ascii diff, not binary.
Rob Landley [Fri, 28 Nov 2014 22:52:06 +0000 (16:52 -0600)]
When running a test, the diff is always an ascii diff, not binary.

9 years agoAdd "change" subdirectory to make clean.
Rob Landley [Fri, 28 Nov 2014 22:51:32 +0000 (16:51 -0600)]
Add "change" subdirectory to make clean.

9 years agoAdd "make change" target to build the big toybox binary as a bunch of little ones...
Rob Landley [Fri, 28 Nov 2014 22:49:46 +0000 (16:49 -0600)]
Add "make change" target to build the big toybox binary as a bunch of little ones (in the "change" subdirectory), and tweak scripts/make.sh to avoid redundant work when rebuilding.

9 years agosed: c needs to trigger range logic like d, D works like d when there isn't anything...
Rob Landley [Fri, 28 Nov 2014 02:38:21 +0000 (20:38 -0600)]
sed: c needs to trigger range logic like d, D works like d when there isn't anything left in the line, and more tests.

9 years agoNew ifconfig tests from Cynt Rynt.
Rob Landley [Thu, 27 Nov 2014 06:28:13 +0000 (00:28 -0600)]
New ifconfig tests from Cynt Rynt.

(I added the "only run if root" stanza at the beginning.)

9 years agoUpdate dmesg, loosely based on a patch from Elliott Hughes.
Rob Landley [Wed, 26 Nov 2014 03:45:18 +0000 (21:45 -0600)]
Update dmesg, loosely based on a patch from Elliott Hughes.

Probe the default buffer size, replace the constants with FLAG_x macros, add -r,
replace the byte at a time output with a single xwrite(), more comments.

9 years agoVariant of a patch from Ashwini Sharma, making df /dev/node work and tweaking the...
Rob Landley [Wed, 26 Nov 2014 00:49:34 +0000 (18:49 -0600)]
Variant of a patch from Ashwini Sharma, making df /dev/node work and tweaking the spacing.

I didn't apply the POSIXLY_CORRECT gnuism because it's a can of worms (as would
be LSB_CORRECT), and you can presumably alias df="df -P" if you want that.

Possibly in future I should factor out the "readahead and align columns based
on measuring the largest value in each" code from ls and apply it here.

9 years agoAndroid-related roadmap.html updates.
enh [Mon, 24 Nov 2014 23:26:09 +0000 (17:26 -0600)]
Android-related roadmap.html updates.

most notably:

* Android switched to mksh several releases ago.

* system/core/reboot is Android's reboot(1) (and sdcard is how
emulated sdcards work in production, not a testing thing).

* I removed all the "apparently unused" tools from the tree, since
they were all actually unused with the exception of lsusb which people
would build as/when they needed it. (which may need resurrecting when
they come back and find there's no "lsusb -v" in toolbox.)

9 years agoTweak the "ignoring return value" fortify workaround for readlinkat.
Rob Landley [Mon, 24 Nov 2014 23:23:23 +0000 (17:23 -0600)]
Tweak the "ignoring return value" fortify workaround for readlinkat.

We zero the buffer and if the link read fails that's left alone, so
it's ok for the symlink not to be there. Unfortunately, typecasting the
return value to (void) doesn't shut up gcc, and having an if(); with the
semicolon on the same line doesn't shut up llvm. (The semicolon on a new
line would, but C does not have significant whitespace and I'm not going
to humor llvm if it plans to start.)

So far, empty curly brackets consistently get the warning to shut up.

9 years agoAs long as Android's going to require fortify, fixup the warnings it generates.
Rob Landley [Sat, 22 Nov 2014 06:36:45 +0000 (00:36 -0600)]
As long as Android's going to require fortify, fixup the warnings it generates.

9 years agoWhitespace/code style.
Rob Landley [Sat, 22 Nov 2014 06:31:03 +0000 (00:31 -0600)]
Whitespace/code style.

9 years agoA patch against your current ToT that builds in AOSP master.
Elliott Hughes [Sat, 22 Nov 2014 03:49:05 +0000 (21:49 -0600)]
A patch against your current ToT that builds in AOSP 

9 years agoDon't include asm/* files directly.
Rob Landley [Fri, 21 Nov 2014 16:06:45 +0000 (10:06 -0600)]
Don't include asm/* files directly.

9 years agoPatch from Elliott Hughes for Android/bionic build.
Rob Landley [Fri, 21 Nov 2014 12:42:37 +0000 (06:42 -0600)]
Patch from Elliott Hughes for Android/bionic build.

9 years agoMake md5sum and sha1sum work on big endian systems.
Rob Landley [Thu, 20 Nov 2014 03:38:00 +0000 (21:38 -0600)]
Make md5sum and sha1sum work on big endian systems.

9 years agoFixups for the android/bionic build probes patch.
Rob Landley [Wed, 19 Nov 2014 22:55:12 +0000 (16:55 -0600)]
Fixups for the android/bionic build probes patch.

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.

9 years agoprobe for getspnam(), forkpty(), utmpx, replace sethostname()
Isaac Dunham [Wed, 19 Nov 2014 22:38:46 +0000 (16:38 -0600)]
probe for getspnam(), forkpty(), utmpx, replace sethostname()

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.

9 years agoFix "tail -c 10" segfault spotted by Lukasz Szpakowski.
Rob Landley [Wed, 19 Nov 2014 20:29:53 +0000 (14:29 -0600)]
Fix "tail -c 10" segfault spotted by Lukasz Szpakowski.

Once we've read through the initial TT.bytes backlog we discard the extra data,
meaning we adjust the remaining amount each time so the overflow is zero bytes.
We were doing the adjustment right, but not zeroing out the overflow counter
after we did so.

9 years agoMore sed bugfixes.
Rob Landley [Tue, 18 Nov 2014 10:25:27 +0000 (04:25 -0600)]
More sed bugfixes.

9 years agosed: fix 'q', and { }, and } after s/// with no semicolon.
Rob Landley [Tue, 18 Nov 2014 03:21:04 +0000 (21:21 -0600)]
sed: fix 'q', and { }, and } after s/// with no semicolon.

9 years agoMore sed corner cases. (Empty regex repeats previous regex, implement -i, etc.)
Rob Landley [Mon, 17 Nov 2014 09:14:05 +0000 (03:14 -0600)]
More sed corner cases. (Empty regex repeats previous regex, implement -i, etc.)

9 years agoFix more sed bugs.
Rob Landley [Mon, 17 Nov 2014 00:58:22 +0000 (18:58 -0600)]
Fix more sed bugs.

9 years agoFix sed 'b' with no label and 'N' in general.
Rob Landley [Sun, 16 Nov 2014 20:21:42 +0000 (14:21 -0600)]
Fix sed 'b' with no label and 'N' in general.

9 years agoMore sed bugfixes. (Did you know s/[/]// is a valid sed expression?)
Rob Landley [Sat, 15 Nov 2014 23:19:23 +0000 (17:19 -0600)]
More sed bugfixes. (Did you know s/[/]// is a valid sed expression?)

9 years agoDebugging pass on sed: make the existing test suite pass.
Rob Landley [Sat, 15 Nov 2014 22:16:29 +0000 (16:16 -0600)]
Debugging pass on sed: make the existing test suite pass.

9 years agoAdd a few more sed tests.
Rob Landley [Fri, 14 Nov 2014 22:44:21 +0000 (16:44 -0600)]
Add a few more sed tests.

9 years agoAdd color support for scripts/test.sh and new SKIP_HOST for tests expected to fail...
Rob Landley [Fri, 14 Nov 2014 22:44:00 +0000 (16:44 -0600)]
Add color support for scripts/test.sh and new SKIP_HOST for tests expected to fail on non-toybox implementations.

9 years agosed: implement s & and \1 backrefs.
Rob Landley [Fri, 14 Nov 2014 21:53:17 +0000 (15:53 -0600)]
sed: implement s & and \1 backrefs.

9 years agoImplement more sed plumbing, including s/// (without \1 or & yet).
Rob Landley [Wed, 12 Nov 2014 20:47:57 +0000 (14:47 -0600)]
Implement more sed plumbing, including s/// (without \1 or & yet).

9 years agoRemove unnecessary assignment spotted by Cynt Rynt.
Rob Landley [Tue, 11 Nov 2014 21:08:25 +0000 (15:08 -0600)]
Remove unnecessary assignment spotted by Cynt Rynt.

9 years agoImplement another largeish chunk of sed. Untested, unfinished, do not use yet.
Rob Landley [Mon, 10 Nov 2014 23:17:17 +0000 (17:17 -0600)]
Implement another largeish chunk of sed. Untested, unfinished, do not use yet.

9 years agoFirst cleanup pass on hwclock.
Rob Landley [Mon, 10 Nov 2014 23:14:11 +0000 (17:14 -0600)]
First cleanup pass on hwclock.

9 years agohwclock: get and set the hwclock
Ashwini Sharma [Mon, 10 Nov 2014 21:26:08 +0000 (15:26 -0600)]
hwclock: get and set the hwclock

9 years agoipcrm : remove msg que, sem or shared memory
Ashwini Sharma [Mon, 10 Nov 2014 21:25:35 +0000 (15:25 -0600)]
ipcrm : remove msg que, sem or shared memory

9 years agoYet more sed tests.
Rob Landley [Sun, 9 Nov 2014 20:16:33 +0000 (14:16 -0600)]
Yet more sed tests.

10 years agoImplement a few sed commands. Not done, and not tested yet.
Rob Landley [Sat, 8 Nov 2014 07:51:59 +0000 (01:51 -0600)]
Implement a few sed commands. Not done, and not tested yet.

10 years agoMore sed tests.
Rob Landley [Thu, 6 Nov 2014 22:26:59 +0000 (16:26 -0600)]
More sed tests.

10 years agoNext round of sed infrastructure, parses most commands now, doesn't implement them...
Rob Landley [Wed, 5 Nov 2014 00:07:46 +0000 (18:07 -0600)]
Next round of sed infrastructure, parses most commands now, doesn't implement them yet.

10 years agoAttached are new toys TR and CRONTAB.
Ashwini Sharma [Thu, 30 Oct 2014 23:36:09 +0000 (18:36 -0500)]
Attached are new toys TR and CRONTAB.

*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.

10 years agoTest for ls -d from Isaac Dunham, and he pointed out -F also disables symlink following.
Rob Landley [Thu, 30 Oct 2014 21:47:29 +0000 (16:47 -0500)]
Test for ls -d from Isaac Dunham, and he pointed out -F also disables symlink following.

10 years agoBug report from Isaac Dunham: ls -d shouldn't follow command line symlinks without...
Rob Landley [Thu, 30 Oct 2014 10:32:54 +0000 (05:32 -0500)]
Bug report from Isaac Dunham: ls -d shouldn't follow command line symlinks without -H or -L (just like ls -l).

10 years agoFirst batch of sed tests.
Rob Landley [Wed, 29 Oct 2014 23:44:33 +0000 (18:44 -0500)]
First batch of sed tests.

Only good for TEST_HOST=1 at the moment because the test infrastructure itself
depends on sed, so if an unfinished sed is in the $PATH it goes boing. But
hey, corner cases!

I have... more.

10 years agoNext drop of sed infrastructure, mostly argument parsing, doesn't do anything interes...
Rob Landley [Wed, 29 Oct 2014 19:49:47 +0000 (14:49 -0500)]
Next drop of sed infrastructure, mostly argument parsing, doesn't do anything interesting yet.

10 years agoFill out rest of help text for sed.
Rob Landley [Wed, 29 Oct 2014 04:43:58 +0000 (23:43 -0500)]
Fill out rest of help text for sed.

10 years agoFix use after free error spotted by ?ukasz Szpakowski.
Rob Landley [Tue, 28 Oct 2014 00:20:31 +0000 (19:20 -0500)]
Fix use after free error spotted by ?ukasz Szpakowski.

10 years agoO_CLOEXEC was confusing the O_RDONLY test in loopfiles(), resulting in attempts to...
Rob Landley [Mon, 27 Oct 2014 23:08:59 +0000 (18:08 -0500)]
O_CLOEXEC was confusing the O_RDONLY test in loopfiles(), resulting in attempts to read from stdout instead of stdin for "-" or no arguments.

10 years agoxexec() recursion limiter has to go after rebound or toy_init() zeroes it.
Rob Landley [Sun, 26 Oct 2014 18:34:33 +0000 (13:34 -0500)]
xexec() recursion limiter has to go after rebound or toy_init() zeroes it.

10 years agoCosmetic tweak: no trailing spaces when ./toybox lists command names.
Rob Landley [Sun, 26 Oct 2014 17:56:41 +0000 (12:56 -0500)]
Cosmetic tweak: no trailing spaces when ./toybox lists command names.

10 years agoBasic sed range support, enough for "sed -n 9,11p README" to work.
Rob Landley [Fri, 24 Oct 2014 23:16:32 +0000 (18:16 -0500)]
Basic sed range support, enough for "sed -n 9,11p README" to work.

10 years agoTeach ln -f to leave original target alone if link creation fails.
Rob Landley [Wed, 22 Oct 2014 22:11:06 +0000 (17:11 -0500)]
Teach ln -f to leave original target alone if link creation fails.

Suggested by Ashwini Sharma, I wound up implementing it by creating the new
link at a temporary name and renaming it over the old one instead of renaming
the old file out of the way and putting it back if it failed.

(Because "mkdir -p one/one/blah && ln -sf /bin/one one" would otherwise
rename one/one out of the way and only notice it can't delete it way at the
end when recovery's darn awkward, vs create new thing and if rename fails
(including EISDIR) that's the main error path. And yes the temporary name
is in the same directory as the destination so we never rename between mounts.)

link over the old one instead of renaming the old file and renaming it back.

10 years agoRandom in-progress snapshot of sed, not finished yet.
Rob Landley [Tue, 21 Oct 2014 02:07:16 +0000 (21:07 -0500)]
Random in-progress snapshot of sed, not finished yet.

10 years agoMore static analysis fixes from Ashwini Sharma.
Rob Landley [Tue, 21 Oct 2014 00:56:05 +0000 (19:56 -0500)]
More static analysis fixes from Ashwini Sharma.

10 years agoAdd TOYBOX_NORECURSE so xexec() won't make internal function calls.
Rob Landley [Tue, 21 Oct 2014 00:52:29 +0000 (19:52 -0500)]
Add TOYBOX_NORECURSE so xexec() won't make internal function calls.