aboutsummaryrefslogtreecommitdiff
path: root/toys
AgeCommit message (Collapse)Author
2024-06-03Use DRAIN instead of FLUSH.Rob Landley
2024-06-02Bump shell script filehandle to high filehandle with O_CLOEXEC.Rob Landley
2024-06-01vi: handle invalid `:g` arguments without buffer overflow.Eric Roshan-Eisner
Replace goto with if block to make variable lifetimes clearer.
2024-06-01vi: fix buffer overflow when entering a ridiculously long commandEric Roshan-Eisner
2024-06-01vi: check for out of bounds read on empty `p` bufferEric Roshan-Eisner
2024-06-01getconf: add NPROCESSORS_CONF and NPROCESSORS_ONLN.Elliott Hughes
New (https://austingroupbugs.net/view.php?id=339) names for the existing _NPROCESSORS_CONF and _NPROCESSORS_ONLN.
2024-06-01Move error handling into ioprio_get/set, and in-passing cleanups.Rob Landley
2024-06-01Fix ionice's return value for getting process IO priorityxiuhong.wang
In the user version, if you use ionice to get the process IO priority without permission, -1 will be returned, but Idle: prio 7 will be printed at this time. This is an incorrect priority and should return permission denied.
2024-05-23Only set speed and flush buffer when -s option supplied.Rob Landley
2024-05-22microcom: Don't crash if failed to open paste fileYi-Yo Chiang
* When running the "paste" command and failed to open the paste file (such as file not found or permission error), don't crash the entire microcom program. Instead print the error message and give the user a chance to fix the problem. * If "paste" command is cancelled by "ESC" or an empty file name, clear the hanging "Filename:" prompt before returning to the main loop.
2024-05-20toysh: implement return.Rob Landley
2024-05-20Stack longjmp return vectors so builtins calling builtins can xexit()Rob Landley
back to the shell.
2024-05-19Add TOYFLAG_NOBUF and make microcom use it.Rob Landley
2024-05-17Change -o to uncollated, add -O for collated.Rob Landley
2024-05-17netcat: add -oRob Landley
2024-05-16Allow netcat -f to communicate with serial devicesYi-Yo Chiang
Right now the (-f) option just opens the tty file and does nothing. Change it so that we actually read from / write to the specified file.
2024-05-10find: use S_ISREG() rather than inlining it.Elliott Hughes
2024-04-30Doc tweak: accept -A as an alias for -a but don't try to explain it.Rob Landley
The help text tries to answer the questions "what does this command do and how do I use it". Toybox silently accepts a lot of compatibility flags like patch -u that aren't in the help text to let it run existing scripts, but skips documenting them if doing so wouldn't doesn't help write NEW scripts.
2024-04-30Switch most remaining toys.optflags&FLAG_x checks to FLAG(x)Rob Landley
2024-04-30Consistently indent help blocks.Rob Landley
2024-04-28Fix hwclock to work with current glibc and musl, which have different bugs.Rob Landley
Glibc 2.31 broke the settimeofday() wrapper to return EINVAL if you set the time and kernel timezone in the same call. (I have no idea why.) Musl broke the settimeofday() wrapper to never call the settimeofday syscall at all, which is the only way to set kernel timezone, and then for good measure removed the __NR_settimeofday symbol from their headers because people were still using it. (So use kernel header instead.) (The kernel timezone is used on machines that dual boot with windows, where the hardware clock is generally set to local time to humor windows. Various filesystem code uses it to adjust the time read from and saved to filesystems shared with windows.)
2024-04-26find -size implies -type f.Rob Landley
2024-04-22xxd: buffer input via stdio.Elliott Hughes
2024-04-20Indent the help text block.Rob Landley
2024-04-05Tweak help text and comments.Rob Landley
2024-04-05Fix thinko.Rob Landley
2024-03-29inotifyd: Don't ignore the first mask character.Peter Collingbourne
2024-03-28inotifyd: enable line buffering.Elliott Hughes
Since the point here is to get a notification for every event, and there's one line per event, line buffering is the right choice.
2024-03-24uchar is useless since we -funsigned-charOliver Webb
2024-03-24bc.c: Large block of numbers -> String for -l libOliver Webb
2024-03-24restorecon: use FLAG() macro for readability.Elliott Hughes
2024-03-22Fix "install -dm 02750 directory" and add tests.Rob Landley
2024-03-21Add env -e to execute a different command than argv[0] from the command list.Rob Landley
2024-03-20If /sys isn't mounted or the loop device is disassociated betweenRob Landley
reading /proc/mounts and asking for follow-up data from sysfs, readfile() returns NULL and there should have been an else case setting it back to "" instead of NULL so the printf() and if (!*ss) free(ss) didn't try to dereference the NULL. That said, the initial "" was only specutavely replaced and then needing to be put back because code really wants a third variable, and I can re-use s if I move the xabspath() down a bit, so...
2024-03-19Teach mount to show file= option when displaying loopback mounts.Rob Landley
2024-03-15Fix first line summary for xzcat.Rob Landley
2024-03-15readelf: fix -n for x86-64 ibt/shstk notes.Elliott Hughes
I couldn't work out how to get gcc to actually produce such a thing, but /bin/dbxtool on my debian box right now has them. The big mistake here is that GNU property notes' data is always 8-byte aligned, so we needed to skip that. That lets us get rid of the existing loop termination hack to skip padding. While I'm here -- since the symptom was running off the end of the file -- I've also added a bounds check in the property dumping loop. I wish I had fuzzing infrastructure to run AFL++ against this every time it changes... In lieu of that I do wonder whether we should add `readelf -aW /bin/* > /dev/null` as a smoke test that "at least it works for all the _valid_ binaries on the system you're testing on". That would have caught this sooner.
2024-03-14hexdump: fix NUL character handlingMathieu Anquetin
When dumping a file containing some NUL characters, the display is wrong because all remaining characters on the line are replaced by NUL. This error comes from the fact that the copy of the read buffer into the line buffer is done using strncpy() which handles NUL character as end of string and pads the destination buffer with NUL afterwards. To avoid data manipulation during buffer copy, simply replace strncpy() with its memory equivalent memcpy() that does not interpret the read data. Signed-off-by: Mathieu Anquetin <mathieu.anquetin@groupe-cahors.com>
2024-03-13watch: flush the buffer each time around the loop.Elliott Hughes
Also fix -b to use \a (alarm) rather than \b (backspace).
2024-03-13Fix use after free.Rob Landley
2024-03-08ping: opt in to line buffering.Elliott Hughes
2024-03-08Adjust documentation to real possible valuesChristian Koestlin
2024-03-03Add mv -x to atomically swap two files.Rob Landley
No idea if Mac or FreeBSD has renameat2(), but glibc refusing to wrap a 10 year old Linux syscall without "#define hurd" is also ridiculous, so I wrapped the syscall myself in portability.c.
2024-03-01Promote getopt.Rob Landley
2024-03-01Cleanup pass.Rob Landley
2024-02-29getopt.c: Formatting, printf -> xprintf/xputsn/putchar, Referance linkOliver Webb
2024-02-27Bugfix for last patch: don't end the stream before writing the data.Rob Landley
2024-02-27xzcat.c: Formatting, Cleanup, Resolve ifdefs, Tests for errors, testing -> ↵Oliver Webb
testcmd, Rearange/Rewrite large comments to be C99, reange code (main at bottom, do_command above it), Remove some function prototypes, Remove "!= 0/NULL", "x == 0" to "!x", uint32_t to unsigned, uint8_t to char, remove vli_type typedef, remove inline (useless in modern C), Hex -> Dec when under 10,
2024-02-27ts, remove MAYFORK, add in LINEBUFOliver Webb
2024-02-21When xargs child exits with 255, stop processing input.Rob Landley