aboutsummaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2014-07-21Little endian and big endian versions of peek (for host.c).Rob Landley
2014-07-21Fix memory leak in error path.Rob Landley
2014-07-20Add utf8 support to ls -C.Rob Landley
Use wcwidth() instead of strlen(), and extend the -q substitution to also whiteout nonprintable characters that are nonparseable utf8 snippets.
2014-07-19find needs "c" suffix to -size.Rob Landley
2014-07-17Use libc daemon() instead of pending daemonize.Rob Landley
2014-06-28Cleanup read_password(), factor out set_terminal(), fix salt bug (des wants ↵Rob Landley
the salt raw, no $ at the beginning).
2014-06-25Cleanup pass on mkpasswd.cRob Landley
2014-06-24find_in_path() is supposed to work with a NULL path, but didn't. Fix it.Rob Landley
2014-06-09Forgot to check in strstart().Rob Landley
2014-06-03mount: start on option parsing, implement loopback and bind mount autodetection.Rob Landley
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-27Add mount options to data getmountlist collects.Rob Landley
2014-05-26Isaac Dunham suggested xprintf() should call fflush() instead of ferror(), ↵Rob Landley
and posix-2008 doesn't say if fflush() covers ferror() (or can return success when the stream's error state is set), so call both.
2014-05-24patch from ashwini sharma: treat 0 length read at the start of password read ↵Rob Landley
as EOF.
2014-05-21Add generic_signal() handler, which sets toys.signal and writes byte to ↵Rob Landley
toys.signalfd if set.
2014-05-21Add free functions for predefined llist types.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-05-06Use compiler built-in macros to determine if argument parsing can use double ↵Rob Landley
or float for FLOAT arguments. (I.E. whether double fits in a long's memory.) Check in a way that the macros not being defined just gives us the shorter one.
2014-05-02In function readfile(), the buffer buf is free'd when readall() fails. This ↵Ashwini Sharma
free can cause a crash, if the buffer passed by user of function is not malloc'ed one. names_to_pid() is one usecase example here.
2014-04-15Probes for O_NOFOLLOW that compile and run something aren't compatible with ↵Rob Landley
cross compiling, so just #define it to 0 if it's not in fcntl.h where posix-2008 says.
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-24Fix mkdir -p with absolute paths.Rob Landley
Stripping leading / is not the right thing to do there. Broken when the code moved to lib and was genericized for use elsewhere.
2014-03-11Move mkpathat to lib, remove redundant function used by patch.Rob Landley
2014-03-11Add "volatile" annotation to peek/poke to stop potential optimizer overreach.Rob Landley
2014-02-28Fix another bug reported by Ashwini Sharma.Rob Landley
2014-02-16Various cleanups found by Tom Sparrow's static analysis.Rob Landley
2014-02-07Move bunzip2 logic from lib into bzcat.Rob Landley
2014-01-28Two changes to shut up GCC:Isaac Dunham
* __GLIBC__ was checked unconditionally; this made for a very messy build on musl. * int fd in chvt is always initialized; GCC 3.4 does not recognize this.
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-27Pass through all the readfile() arguments from xreadfile().Rob Landley
2013-12-23Attached is an implementation for groupdel.Ashwini Sharma
This is aliased to delgroup, for a requirement at my end. Also lib/password.c is modified to along with.
2013-12-23Fix some issues raised (albeit indirectly) by Isaac Dunham.Rob Landley
POLL_IN defined as a constant by some libc. Factor out login.c's change_identity() to xwrap.c as xsetuser(). Replace xsetuid() with xsetuser() Put a space between argument globals and non-argument globals. TT starts zeroed, don't need to re-zero entries in it. STDIN_FILENO has been 0 since 1969, even DOS copied that. Just say 0. Added an xchroot() using xchdir() to lib/xwrap.c. Remove endgrent() call until somebody can explain why it was there.
2013-12-19Only define MNT_DETACH for old glibc, portability.h included _before_ ↵Rob Landley
sys/mount.h...
2013-12-19Regression test against Ancient Build Environment (Ubuntu 8.04), fixup bit-rot.Rob Landley
2013-12-19Move names_to_pid from pending to lib.Rob Landley
2013-12-08Doing math on void pointers isn't portable, reported by Nathan McSween.Rob Landley
2013-11-28Oops, cleaned up ifconfig uses atolx_range() instead of get_int_list(). ↵Rob Landley
Check that in.
2013-11-28Add xgetpwnam() to lib/xwrap.c.Rob Landley
2013-11-28Move xgetpwuid() and xgetgrgid() into xwrap.cRob Landley
2013-11-10du from Ashwini Sharma.Rob Landley
2013-11-10Break out lib/pending.h from lib/lib.h.Rob Landley
2013-11-07Tweak terminal_size to never set either to 0, and return true/false whether ↵Rob Landley
it could determine at least one coordinate. (If you set $COLUMNS but not $ROWS, we assume you're happy with the 80x25 default for the other.)
2013-11-03Fix off by one, pointed out by Ashwini Sharma.Rob Landley
2013-11-02Give xstrncpy() a more informative error message.Rob Landley
2013-11-02Merge toynet.h into toys.h: musl supports it and micromanaging uClibc config ↵Rob Landley
options isn't very interesting anymore.
2013-10-27Refactor terminal querying.Rob Landley
2013-10-16Minor lib/password.c cleanup, described on the list. (Inline two functions.)Rob Landley
2013-10-16Prep work for useradd by Ashwini Sharma.Rob Landley
2013-10-06Whitespace tweaks and remove unused variable.Rob Landley