aboutsummaryrefslogtreecommitdiff
path: root/toys/posix
AgeCommit message (Collapse)Author
2014-06-09When locale is enabled, sprintf("%.123s", str) is counting characters, not ↵Rob Landley
bytes, so we can't globally enable locale without opening stack/heap smashing vulnerabilities. Make commands individually request setlocale() using TOYFLAGS instead.
2014-06-02Help text should have a blank line after usage: lines, and a couple other ↵Rob Landley
whitespace tweaks.
2014-06-01cpio: archive more filesIsaac Dunham
While writing tests for cpio, I found that cpio tries to open empty files if they're regular files, and fails to archive them if unreadable. This can be easily avoided, and is not the usual behavior.
2014-05-31Introduce xfork() and make commands use it, and make some WEXITSTATUS() use ↵Rob Landley
WIFEXITED() and WTERMSIG()+127.
2014-05-29Switch mtab_list to doubly linked so we can traverse in either order. ↵Rob Landley
Convert umount and df. Add dlist_terminate() to break lists for traversal in either direction.
2014-05-25logname and whoami are the same as id -un, so merge them.Isaac Dunham
Since the starting letters are greater than those for 'id' or 'groups', we cn just check if the first letter is greater than 'i'.
2014-05-24Remove debug detritus I didn't mean to to check in, and treat an "this ↵Rob Landley
variable can never actually be used uninitialized but gcc's warning generator can't tell and fails spamwards" warning.
2014-05-22date: add -ds, document +FORMAT escapes.Rob Landley
2014-05-06Switch human_readable() to just outputing decimal kilo/mega/gigabytes, make ↵Rob Landley
du use it, move it from lib/pending.c to lib.c.
2014-04-29Teach cpio to set uid/gid and timestamp. (Timestamp has year 2100 problem.)Rob Landley
Note that directory timestamps are still sometimes wrong because creating things in a directory can update the timestamp. Also, cp -r has logic to ensure we can write to a directory that doesn't have write permission, cpio does not. This is fixable, but not what existing cpio does.
2014-04-25Fix od bug reported by Samuel Holland ("od -v -b" was appending default ↵Rob Landley
output type even though an output type was specified).
2014-04-16Revert lots of half-finished local debris I didn't mean to check in with ↵Rob Landley
Isaac's roadmap update. Mercurial's "import" command is still broken, committing local tree changes to files that weren't even touched by the patch because the hg developers inisist, when I point out how stupid it is, that they meant to do that. (hg record can do hunks, but import can't even track _files_.)
2014-04-12roadmap: describe glibc commands.Isaac Dunham
Some glibc commands are irrelevant because they're for functionality that is excluded from musl (mtrace, rpc*, localedef, iconvconfig, nscd). getconf and catchsegv look like candidates for the development toolchain; locale and iconv were already triaged. getent is pretty lame, but it and the timezone stuff (tzselect zic zdump) are the only new possibly interesting commands.
2014-04-10Fix date setting, and fluff out help text a bit.Rob Landley
2014-03-29Group headers by standard (POSIX or LSB) or function (internationalization, ↵Rob Landley
networking). Move headers standards ignore (but which have been there >15 years) to lib/portability.h. Fold xregcomp into lib since it's posix.
2014-03-27Fix cpio -it: don't close(fd) unless we opened it.Isaac Dunham
2014-03-26More cpio bugfixes from Isaac Dunham.Rob Landley
Fix FLAG_o to actually be 1 like the comment says, don't try to strlen(name) before reading it, pad TRAILER!!! entry correctly.
2014-03-25Promote cpio out of pending.Rob Landley
After some waffling I put it in "posix", even though it was last specified in susv2 (where it was the obsolete 6 byte header entries predating susv4). LSB specifies it, including the 8 byte header fields, but for the actual command it just references SUSv2. (LSB isn't so much a standard as Red Hat's "notes to self".)
2014-03-16Clarify an unclear comment pointed out by Steve Long.Rob Landley
2014-03-11Move mkpathat to lib, remove redundant function used by patch.Rob Landley
2014-03-11Factor out mkpathat.Rob Landley
2014-02-22Add -H option to cksum (hex output), fix to use FLAG macros.Rob Landley
2014-02-04Tweak help text.Rob Landley
2014-01-29More elaborate help text collating logic.Rob Landley
2014-01-16Rename xmsprintf() to just xmprintf().Rob Landley
Partly because there's no supplied target string ala sprintf, and partly because I can never remember what order the m and s go in.
2013-12-29Add -zZ support to grep (NUL delimited input/output).Rob Landley
2013-12-27Pass through all the readfile() arguments from xreadfile().Rob Landley
2013-12-18ln -v support from Ashwini Sharma (comment tweak from me)Rob Landley
2013-12-18Ashwini Sharma added -v, I tweaked it a bit and added a couple test suite ↵Rob Landley
entries.
2013-12-08Can't test <0 on an unsigned, reported by Nathan McSween.Rob Landley
2013-12-03Redo od whitespace with multiple output types so the columns align.Rob Landley
Factor out single output type into od_out_t(), call it in a loop for each type finding largest output (and if output consumes more than one byte of input average rounding up), pad each output to the largest output times number of bytes input consumed.
2013-11-30Fix cut.Rob Landley
Some commands went in before "pending", and thus need cleanup but are enabled in defconfig. The fact cut used a function out of lib/pending.c is a hint it might be in this category...
2013-11-28Add xgetpwnam() to lib/xwrap.c.Rob Landley
2013-11-28Move xgetpwuid() and xgetgrgid() into xwrap.cRob Landley
2013-11-09grep doesn't allocate enough spaceWilliam Haddon
Grep miscalculates the amount of memory it needs to allocate when "converting strings to one big regex" when the -e flag is not specified. Since in this case "\|" is inserted between strings rather than "|", two extra bytes rather than one need to be provided for each string. I noticed this because it caused grep to seg-fault on musl when a regex of exactly seven characters is provided.
2013-10-31Patch from William Haddon to make xargs with blank input call its command ↵Rob Landley
line once. (Tweaked slightly for whitespace and to collate variable declarations.)
2013-10-31Make the patch -x option (only enabled with CONFIG_DEBUG) provide more ↵Rob Landley
information about why a patch didn't apply. (Offset of first nonmatching character at each line during seek phase.)
2013-10-27Promote nl from pending to posix, and add tests.Rob Landley
2013-09-21Tweak args (yank old + that never worked, rename | to +), and add uname -o ↵Rob Landley
as a synonym for -s.
2013-09-16Fix -t c0 and -J as reported by heehooman at gmail on the list.Rob Landley
Also fix up help text, and hook up -c.
2013-09-10First pass of cut cleanup, and make test script slightly happier with the ↵Rob Landley
concept of 80 character lines.
2013-09-09Minor cleanups.Rob Landley
2013-09-09Don't write a zero past end of toybuf with large -d value.Rob Landley
2013-09-09Minor cosmetic tweaks to expand.Rob Landley
Working my way through the to-review list that predates the "pending" directory. This gets expand off my to-review list. (Proof that "need to review" doesn't mean it's in bad shape, this command was fine. Changed capitalization in the help text because I'm trying to have "user supplies this value" be all caps, switched a read() to readall() although I'm not sure modern kernels actually allow -EINTR to generate zero length reads anymore, and since most of the loopfiles() target functions are called do_commandname() changed the name to that just so it's regular. None of the changes are actually important. :)
2013-09-09Adjust patch to use dlist_pop()Rob Landley
2013-09-09Redo tail closer to the original design. Add more tests for large data sets. ↵Rob Landley
(Still no -f support yet.)
2013-09-06Missing typecast in recent rm fix. Oops.Rob Landley
2013-08-30uname: Fix help stringElie De Brauwer
2013-09-05env - there were 2 segfaults when run on my Ubuntu 12.04 machine:Jacek Bukarewicz
- one is because eglibc sets environ to NULL on clearenv(). I added check for environ being not NULL when iterating over environment variables - switched xexec to xexec_optargs because command argument is a pointer to optarg which is freed by xexec.
2013-09-05Make chdir handle permissions according to posix, reported by Jacek Bukarewicz..Rob Landley