Rob Landley [Sun, 28 Sep 2014 18:15:41 +0000 (13:15 -0500)]
mount: terminate list so unknown user mount attempts don't endlessly loop, add better error reporting.
Rob Landley [Sun, 28 Sep 2014 18:11:20 +0000 (13:11 -0500)]
Brown paper bag time: comma_scan() didn't work for anything but the last entry.
Rob Landley [Sun, 28 Sep 2014 02:07:00 +0000 (21:07 -0500)]
Multi-build single.sh should exit with an error when build breaks.
Rob Landley [Sun, 28 Sep 2014 02:04:47 +0000 (21:04 -0500)]
Cleanup pass on groupdel.
Rob Landley [Sun, 28 Sep 2014 01:31:16 +0000 (20:31 -0500)]
Allow single.sh to build more than one command per invocation.
Rob Landley [Sun, 28 Sep 2014 01:28:33 +0000 (20:28 -0500)]
Untangle id/groups/logname so single.sh can build each one standalone.
Rob Landley [Sun, 28 Sep 2014 00:59:28 +0000 (19:59 -0500)]
Have OLDTOY emit (redundant) function prototype so single.sh can build OLDTOY standalone (if it has its own config symbol).
Rob Landley [Sun, 28 Sep 2014 00:58:18 +0000 (19:58 -0500)]
Don't segfault for --help of single.sh build of OLDTOY commands that use another command's help.
Rob Landley [Fri, 26 Sep 2014 23:49:44 +0000 (18:49 -0500)]
The only illegal characters in a username are ":" (field separator), "\n" (line separator), and "/" (filename separator).
Restricting usernames to the legacy posix character allowed set (for filenames,
so the $HOME directory is creatable on VFAT and similar) means you can't have
UTF-8 usernames. Linux allows any character but / and NUL in filenames.
Since root is creating these entries, we assume root knows what it's doing.
Rob Landley [Fri, 26 Sep 2014 23:42:23 +0000 (18:42 -0500)]
Separate more commands so single.sh can build them standalone.
?ukasz Szpakowski [Mon, 22 Sep 2014 13:32:21 +0000 (08:32 -0500)]
When killall was invoked without arguments, there appeared segmentation fault
Felix Janda [Mon, 22 Sep 2014 13:22:12 +0000 (08:22 -0500)]
Fix du test: du symlink -> "0\tsymlink"
Rob Landley [Mon, 22 Sep 2014 12:52:15 +0000 (07:52 -0500)]
Respond to two static analysis issues in dirtree_path() reported by Ashwini Sharma.
dirtree->name is an array, not a pointer, so can't be zero. Remove the test.
We dereference plen without checking it for null but calling dirtree_path(0, 0)
is pilot error: only the _first_ call can have plen = 0. Add a comment.
Rob Landley [Mon, 22 Sep 2014 03:44:20 +0000 (22:44 -0500)]
Start on ping.c.
Rob Landley [Sat, 20 Sep 2014 23:46:47 +0000 (18:46 -0500)]
Tweak portability.h for uClibc version in buildroot defconfig.
I've been locally patching uClibc to not violate posix-2008 (you don't need
to define a GNU macro to get a posix function), but uClibc is obsolete and
moribund (development peaked in 2006, last bugfix release was over 2 years
ago), and the largest remaining user (buildroot) doesn't bother to apply such
a patch. Since even buildroot is slowly migrating to musl-libc, just do the
portability tweak for what the last release of the old thing actually did.
Rob Landley [Sat, 20 Sep 2014 22:51:23 +0000 (17:51 -0500)]
Always call setlocale if I18N is enabled, so nested toy_exec() can switch it back off if necessary.
Rob Landley [Sat, 20 Sep 2014 19:20:28 +0000 (14:20 -0500)]
Delete generated/README.txt (the contents are in code.html now) so clean can just remove the "generated" directory entirely.
Rob Landley [Sat, 20 Sep 2014 19:12:55 +0000 (14:12 -0500)]
Capitalize "toybox" more consistently on the about page.
Rob Landley [Sat, 20 Sep 2014 19:11:59 +0000 (14:11 -0500)]
Fluff out the documentation some more.
Rob Landley [Sat, 20 Sep 2014 18:22:24 +0000 (13:22 -0500)]
Remove debug echo checked in by mistake.
Rob Landley [Sat, 20 Sep 2014 18:22:13 +0000 (13:22 -0500)]
Forgot to check in the updated makefile when I moved the testsuite.
(Did you know you can test individual commands with scripts/test.sh command?
Now you do...)
Rob Landley [Sat, 20 Sep 2014 18:20:17 +0000 (13:20 -0500)]
Typo from the dawn of time: toybox is not capitalized the way BusyBox was.
It's just a word. Capitalize at the start of the sentence, otherwise don't.
Yeah, it could be always capitalized as a proper name but since the command
"toybox" is all lower case, that would be weird.
Rob Landley [Sat, 20 Sep 2014 18:18:44 +0000 (13:18 -0500)]
The ancient GPL (copied from the 2.6.12 kernel) build infrastructure is actually in the "kconfig" directory, not under scripts. Remind me to write a new one from scratch...
(Someone actually submitted a basic kconfig rewrite in awk once, but until I
bite the bullet and write my own awk.c, I just don't know awk well enough to
maintain a large script written in it. Back when I maintained kernel.org/doc
I wrote http://landley.net/hg/kdocs/file/tip/make/menuconfig2html.py but
I am NOT reintroducing python as a build dependency. And neither actually
implemented actual menuing part. So... todo list.)
Rob Landley [Sat, 20 Sep 2014 18:09:14 +0000 (13:09 -0500)]
Move testsuite out of scripts/test into its own top level tests directory, and make ctrl-c kill "make test" more reliably.
Rob Landley [Sat, 20 Sep 2014 18:07:53 +0000 (13:07 -0500)]
Give library probe a progress indicator, and use 150% of detected CPUs to try to keep large SMP machines busy (each compiler invocation is short so they exit almost as fast as we launch them).
Rob Landley [Thu, 18 Sep 2014 23:07:58 +0000 (18:07 -0500)]
Reorder functions to get rid of unnecessary prototypes, and move a global into GLOBALS.
Isaac Dunham [Thu, 18 Sep 2014 18:05:21 +0000 (13:05 -0500)]
rm -rf needs to chmod directories to u+rwx, because directories need +x to search.
(Fixes messages about not being able to delete directories when running make test).
Ashwini Sharma [Thu, 18 Sep 2014 16:47:42 +0000 (11:47 -0500)]
A few fixes for issues reported in static analysis.
Rob Landley [Thu, 18 Sep 2014 01:21:44 +0000 (20:21 -0500)]
Cleanup pass on README.
Other versions are adding Cached from /proc/meminfo to free buffers/cache
(and subtracting it from used), but sysinfo() doesn't provide it. (But it
provide "high memory", which hasn't been relevant for almost a decade...)
But that's a design change, not a cleanup issue.
Rob Landley [Wed, 17 Sep 2014 23:25:05 +0000 (18:25 -0500)]
Update README for pending directory, include list of code outside of pending (grandfathered) awaiting cleanup.
Rob Landley [Wed, 17 Sep 2014 23:24:10 +0000 (18:24 -0500)]
Minor cleanup pass on touch.
Rob Landley [Wed, 17 Sep 2014 13:26:07 +0000 (08:26 -0500)]
Cleanup pass on cut, more to do.
Cut predates the "pending" directory, so was checked in as-is. Ashwini
Sharma's recent static analysis fixes touched this file, but there's a lot
more to do than the static analyzer found.
Rob Landley [Tue, 16 Sep 2014 12:21:56 +0000 (07:21 -0500)]
Cleanup pass on useradd.
Rob Landley [Mon, 15 Sep 2014 02:24:50 +0000 (21:24 -0500)]
Add cpio -p
Rob Landley [Mon, 15 Sep 2014 01:37:23 +0000 (20:37 -0500)]
find -xdev should return mount points, just not contents.
Rob Landley [Mon, 15 Sep 2014 00:54:19 +0000 (19:54 -0500)]
Second attempt at one way xpopen().
Rob Landley [Sun, 14 Sep 2014 17:29:44 +0000 (12:29 -0500)]
Split xpopen() into xpopen_both(), xpopen(), and xrun() depending on whether we want to redirect both, one, or neither of stdin/stdout.
Rob Landley [Sat, 13 Sep 2014 19:48:37 +0000 (14:48 -0500)]
Bug report from luckboy: rm -f on a broken symlink didn't work because our "does it exist" test (to avoid errors on rm -f of nonexistent files) said it didn't.
The fix: replace the access() with unlink(), which produces the same "does not
exist" errno and has the added bonus of acting as a fastpath for rm -f on
non-directories. (And since it produces a different error on directories,
falls through to the old behavior there.)
Most of this commit is comment updates explaining being subtle. :)
Rob Landley [Fri, 12 Sep 2014 01:50:10 +0000 (20:50 -0500)]
Create a generated/build.sh with a single compiler command line to rebuild the toybox_unstripped binary using the existing generated/*.h files.
This way we can snapshot the generated/*.{h,sh} from a defconfig build into
a "shipped" directory or something, and then people can maybe build on crazy
crippled environments like pcbsd that haven't got gmake and put bash under
/usr/local so none of the #!/scripts can find it. This solves at least
part of the "toybox can build with itself but you need to build toybox first
to have the tools to run the build scripts" problem.
Next up: work out the minimal config to provide the build tools needed
to run an actual build. (This should, eventually, include a "make" command
if freebsd's kernel is going to refuse to build with netbsd's "make" and
we don't just write off the whole thing as crazy. But it probably shouldn't
include commands that #include <linux/*.h> if we are trying to make that work.)
Rob Landley [Thu, 11 Sep 2014 05:04:37 +0000 (00:04 -0500)]
Oops, unbreak make.sh.
Clearing out old .o files needs -r now that generated/obj has its own subdirectory. (Works if you make clean between, but shouldn't need it.)
Rob Landley [Wed, 10 Sep 2014 04:44:48 +0000 (23:44 -0500)]
Ignore -m option to cpio, it's what we do anyway so it's not an error.
Rob Landley [Wed, 10 Sep 2014 04:42:25 +0000 (23:42 -0500)]
Two problems: 1) Sometimes toy_exec() needs to re-exec to gain dropped root permissions, 2) shouldn't recurse forever without exec, stack depth increases and we may leak other resources. Limit it to ~5 levels.
Rob Landley [Wed, 10 Sep 2014 01:13:03 +0000 (20:13 -0500)]
Make tweaks: collate generated/*.o files into their own subdirectory, add PIPEFAIL for better error reporting, and simpler regex to select toys/*/*.c list based on NEWTOY/OLDTOY macros.
Rob Landley [Mon, 8 Sep 2014 13:51:45 +0000 (08:51 -0500)]
Fix more memory leaks reported by Ashwini Sharma.
Rob Landley [Mon, 8 Sep 2014 13:40:06 +0000 (08:40 -0500)]
Don't close device handle until after calling flush ioctls, reported by Ashwini Sharma.
Rob Landley [Mon, 8 Sep 2014 13:26:02 +0000 (08:26 -0500)]
Add error test and fix memory leak, reported by Ashwini Sharma.
Rob Landley [Mon, 8 Sep 2014 00:33:18 +0000 (19:33 -0500)]
Promote mount. It's not perfect, but it basically works now.
Rob Landley [Mon, 8 Sep 2014 00:30:05 +0000 (19:30 -0500)]
Fix mount --move bug.
Rob Landley [Sun, 7 Sep 2014 19:42:51 +0000 (14:42 -0500)]
Debugging pass on mount. Not quite done yet, but the basics seem to work now.
Rob Landley [Sat, 6 Sep 2014 18:24:58 +0000 (13:24 -0500)]
Work around uClibc brain-damage.
Rob Landley [Thu, 4 Sep 2014 05:23:51 +0000 (00:23 -0500)]
Don't hang for $CPUS=1.
echo prints a newline if it has nothing to print, so wc -l always returns at least 1. Fix: echo -n
Divya Kothari [Wed, 3 Sep 2014 18:38:18 +0000 (13:38 -0500)]
Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari [Wed, 3 Sep 2014 18:32:32 +0000 (13:32 -0500)]
chmod testsuite and link testsuite.
Chmod ?
In this testsuite after change file mode bits, we are comparing file mode with expected ones.
One additional "." is coming with modes (actual result). That?s why test cases are getting failed.
This patch will remove additional "." from actual result.
Link ?
Added more test cases.
Rob Landley [Mon, 1 Sep 2014 17:47:32 +0000 (12:47 -0500)]
Add cp -F to force delete of existing destination files, and make install command use that.
-F is equivalent to the gnu/dammit flag --we-think-long-options-without-short-options-are-a-good-idea
Rob Landley [Mon, 1 Sep 2014 03:07:43 +0000 (22:07 -0500)]
More parallel build tweaks.
echo "$PENDING" needs the quotes to avoid gluing the lines together, which
prevents wc -l or head -n +2 from working right.
Rob Landley [Sun, 31 Aug 2014 19:06:37 +0000 (14:06 -0500)]
Next mount checkpoint.
Testing level: It compiled. If any portion of this works, I'll be amazed.
Still a bunch of todo items (see giant TODO block after globals)
Rob Landley [Sun, 31 Aug 2014 16:58:39 +0000 (11:58 -0500)]
Give a hint when setuid logic fails.
Toybox expects to be setuid root; setuid some other user confuses the attempt to drop privileges, and we err on the side of avoiding shenanigans.
Rob Landley [Sat, 30 Aug 2014 22:44:07 +0000 (17:44 -0500)]
Old compilers complain about linker options passed with -c, so split out $LDOPTIMIZE.
Rob Landley [Sat, 30 Aug 2014 21:34:46 +0000 (16:34 -0500)]
Another fix from Johan Bergstr?m, using the gnu/dammit version of sort on the host can be screwed up by more than one environment variable.
Rob Landley [Sat, 30 Aug 2014 18:03:40 +0000 (13:03 -0500)]
Add VERBOSE=fail to "make tests", based on suggestion from Johan Bergstr?m.
Ashwini Sharma [Tue, 26 Aug 2014 03:01:11 +0000 (22:01 -0500)]
ipcs : display all the IPC fascilities information
crond : CRON scheduler
Rob Landley [Mon, 25 Aug 2014 04:46:23 +0000 (23:46 -0500)]
Work in progress snapshot of mount, with fallout to umount. (Not done yet.)
Rob Landley [Mon, 25 Aug 2014 03:42:47 +0000 (22:42 -0500)]
Fix parallel make not always catching errors before link time.
jobs -p removes finished jobs from the list after reporting them once,
so we need to record the output and remove duplicates ourselves.
Rob Landley [Sun, 24 Aug 2014 04:08:59 +0000 (23:08 -0500)]
Promote blockdev to other.
Rob Landley [Sun, 24 Aug 2014 04:08:04 +0000 (23:08 -0500)]
Cleanup blockdev.
Isaac Dunham [Sat, 23 Aug 2014 04:34:52 +0000 (23:34 -0500)]
getty needs fd 0 to stay open.
The O_CLOEXEC reversal resulted in login failing.
Rob Landley [Thu, 21 Aug 2014 03:23:39 +0000 (22:23 -0500)]
Promote inotifyd to other.
Rob Landley [Thu, 21 Aug 2014 03:22:46 +0000 (22:22 -0500)]
Minor help text tweak for inotifyd.
Rob Landley [Thu, 21 Aug 2014 03:21:36 +0000 (22:21 -0500)]
Cleanup inotifyd.
Rob Landley [Tue, 19 Aug 2014 00:10:45 +0000 (19:10 -0500)]
Cleanups on useradd/groupadd/groupdel, and put TOYBOX_UID_SYS and TOYBOX_UID_USR in the top level Config.
Rob Landley [Sat, 16 Aug 2014 14:46:42 +0000 (09:46 -0500)]
Add install to cp/mv.
Rob Landley [Fri, 15 Aug 2014 23:53:01 +0000 (18:53 -0500)]
Fix bug reported by Ashwini Sharma: [-abc] syntax to switch off a command forget
s _all_ saved command line arguments in GLOBALS(), not just for the command bein
g dropped.
Rob Landley [Fri, 15 Aug 2014 15:50:39 +0000 (10:50 -0500)]
If string_to_mode() is called on a base mode with S_ISDIR() and such set, pass those extra bits through.
Rob Landley [Tue, 12 Aug 2014 23:05:55 +0000 (18:05 -0500)]
Enable a command's sub-options in single builds.
Ashwini Sharma [Tue, 12 Aug 2014 12:14:58 +0000 (07:14 -0500)]
A toy _BLOCKDEV_ to get/set block device properties.
Ashwini Sharma [Tue, 12 Aug 2014 12:09:01 +0000 (07:09 -0500)]
Patches to commands for issues reported from static analysis tool.
portability.h.patch - it is for O_CLOEXEC, as compiler complained of it.
Makefile.patch - for cleaning generated/*.o files and libopts.dat file
[Fixup to uniq.c from Rob.]
Rob Landley [Tue, 12 Aug 2014 01:15:19 +0000 (20:15 -0500)]
Promote lspci.
Rob Landley [Tue, 12 Aug 2014 01:11:58 +0000 (20:11 -0500)]
Cleanup pass on lspci.
Rob Landley [Sun, 10 Aug 2014 17:01:49 +0000 (12:01 -0500)]
Update clean to clean up after new parallel build.
Rob Landley [Sun, 10 Aug 2014 04:49:48 +0000 (23:49 -0500)]
Disable xopen's default O_CLOEXEC for oneit.
Rob Landley [Sat, 9 Aug 2014 19:33:34 +0000 (14:33 -0500)]
Parallelize the build. (set CPUS=1 to force single processor build, or another number to override processor count autodetect.)
Rob Landley [Fri, 8 Aug 2014 04:19:18 +0000 (23:19 -0500)]
Fix -mindepth and -maxdepth to not drill down into excluded directories.
The fact other implementations don't implement "! -mindepth" doesn't mean we can't. Also, find uses +N, N, -N for everything else but this extension doesn't. Also, -depth already had a definition and this has nothing to do with that. It's a poorly thought-out extension, is what I'm saying.
Rob Landley [Wed, 6 Aug 2014 04:21:18 +0000 (23:21 -0500)]
More find bugfixes.
Rob Landley [Wed, 6 Aug 2014 00:44:59 +0000 (19:44 -0500)]
Rereading posix find.c page: "Specifying more than one of the mutually-exclusive options -H and -L shall not be considered an error. The last option specified shall determine the behavior of the utility."
Rob Landley [Wed, 6 Aug 2014 00:41:36 +0000 (19:41 -0500)]
find.c: Posix wants loop detection.
Rob Landley [Wed, 6 Aug 2014 00:32:44 +0000 (19:32 -0500)]
Building busybox from source needs find -not (a synonym for posix's "!").
Rob Landley [Wed, 6 Aug 2014 00:27:02 +0000 (19:27 -0500)]
Fix a couple patch bugs concerning error output.
Rob Landley [Tue, 5 Aug 2014 00:28:41 +0000 (19:28 -0500)]
find.c: add -mindepth, -maxdepth, and document -newer and -depth.
Rob Landley [Sun, 3 Aug 2014 20:50:10 +0000 (15:50 -0500)]
Implement exec -user, -group, and -newer. Enable find in defconfig.
Rob Landley [Sun, 3 Aug 2014 02:07:43 +0000 (21:07 -0500)]
Squash mix of tabs and spaces to just spaces.
Rob Landley [Sun, 3 Aug 2014 00:54:38 +0000 (19:54 -0500)]
Missed checking in dirtree_recurse() change (now needs specific DIRTREE_SYMFOLLOW value, not just true/false).
Rob Landley [Sun, 3 Aug 2014 00:52:44 +0000 (19:52 -0500)]
Cosmetic tweak, slightly more conventional for loop.
Rob Landley [Sun, 3 Aug 2014 00:50:03 +0000 (19:50 -0500)]
Yank xrealpath prototype since the function's gone.
Rob Landley [Sun, 3 Aug 2014 00:49:10 +0000 (19:49 -0500)]
Add --help support to single.sh builds.
Rob Landley [Sun, 3 Aug 2014 00:40:35 +0000 (19:40 -0500)]
Unbreak find -exec.
Ashwini Sharma [Sat, 2 Aug 2014 17:00:20 +0000 (12:00 -0500)]
New toys unified DIFF and USERDEL.
Bradley Conroy [Sat, 2 Aug 2014 16:49:30 +0000 (11:49 -0500)]
mix.c - A very basic mixer.
Rob Landley [Fri, 1 Aug 2014 23:50:46 +0000 (18:50 -0500)]
factor: catch integer overflow.
Now factor
9223372036854775783 (largest positive 64 bit signed prime) takes a
couple minutes but gives the right answer.
Rob Landley [Fri, 1 Aug 2014 14:08:00 +0000 (09:08 -0500)]
Add factor.
I was reading http://www.muppetlabs.com/~breadbox/txt/rsa.html and it mentioned
"factor" and I noticed it was in coreutils. I'm not sure why it's in coreutils,
but it's pretty trivial, so...
Rob Landley [Thu, 31 Jul 2014 01:21:13 +0000 (20:21 -0500)]
find.c: fix -iname.