aboutsummaryrefslogtreecommitdiff
path: root/toys/lsb
AgeCommit message (Collapse)Author
2016-02-25Fix more warnings on 32 bit builds.Rob Landley
2016-02-25Fix bug where mount -o leftover string didn't get passed through to kernelRob Landley
for 2-argument version.
2016-02-17Fix remounting /system on Android.Elliott Hughes
This adds the missing "relatime" option, fixes error handling logic (mount returns 0/-1, not an errno value, and I at least get EACCES rather than EROFS in the case where the underlying block device is read-only; we should also probably only try again if the ioctl actually succeeded), and adds the missing newline in case where we go around and try again read-only. The test case was "mount -o rw,remount /system" on Android.
2016-02-10Add seq -w, suggested by izabera.Rob Landley
2016-02-10Factor out strnstr() since posix hasn't got it, and add a config option forRob Landley
the deeply sad passwd heuristics that don't even check numbers and punctuation.
2016-01-22Factor out insanitize() from seq.c to next_printf() in lib.Rob Landley
2016-01-05Add error_msg_raw() and friends, replace error_msg("%s", s) uses, enable formatRob Landley
checking, and fix up format checking complaints. Added out(type, value) function to stat to avoid a zillion printf typecasts.
2015-12-30Don't let mktemp -q /path/to/file delete arbitrary files, and don't haveRob Landley
"mktemp -u > /dev/full" leave file around.
2015-12-30lsb/mktemp: Add -u flagKylie McClain
The -u flag creates a file, and unlinks it before exiting. This is usually known as "unsafe mode", or "dry-run" mode. GNU mktemp has it, as does Busybox's mktemp and likely many others.
2015-12-29Make pidof use comma_scan()Rob Landley
2015-09-23xexec() is noreturn.Rob Landley
2015-09-11Replace toys.exithelp with help_exit() in lib.Rob Landley
2015-09-07Remove prompt argument from yesno(), caller can fprintf(stderr, "blah") itself.Rob Landley
This fixes the build break, the change to yesno() prototype accidentally got checked in last commit. (Oops, sorry.)
2015-09-05Add seq -f tests, tweak help text, and catch one more error case.Rob Landley
2015-09-02seq -f %0-f is a valid pattern.Rob Landley
2015-09-02If you start a git commit and then edit the file more on the filesystemRob Landley
before saving, the updates don't go in the commit. Behavior difference between git and mercurial, that. Good to know.
2015-09-02Sanitize seq -f string.Rob Landley
2015-07-01Improve -Z error reporting.Elliott Hughes
The most likely reason for setfscreatecon to fail is that you don't have permission, and that's reported by the write return EACCES. There isn't really a "bad" context; they're just strings. Before: $ adb shell mkdir -Z x y mkdir: bad -Z 'x' After: $ adb shell mkdir -Z x y mkdir: -Z 'x' failed: Permission denied Other than this, the ToT mkdir works fine with SELinux.
2015-06-15Use lsm_set_create() to set security blanket context before mknod, avoidingRob Landley
racy gap between create/label.
2015-05-31mknod: Add -Z optionJosé Bollo
Change-Id: I23174fb7b54d029784e6d7460368128113090079
2015-05-14Bugfix from Hyejin Kim: su should not prompt root user for new user's password.Rob Landley
2015-05-03Fix dmesg -c error output.Elliott Hughes
Use perror_exit to show the likely "Operation not permitted" if klogctl fails.
2015-05-03Minor dmesg cleanup.Rob Landley
2015-05-02dmesg: add -t suppress timestamp flagMark Salyzyn
2015-04-12Before trying to remount read only, see if block device responds to "become rw"Rob Landley
ioctl(). (This is a thing Android's old mount already does.)
2015-04-04To ensure that toybox can be installed alongside busybox withoutPaul Barker
confusing update-alternatives, the paths of the links installed by toybox should match those installed by busybox. This is accomplished by changing the flags of a few tools within toybox.
2015-03-11Fix mktemp when TMPDIR is set to empty string, reported by Kylie McClain.Rob Landley
2015-03-10Add -m to mknodRob Landley
2015-03-01Patches from Elliott Hughes to add missing arguments to error_exit() calls.Rob Landley
2015-02-12Fix bug introduced by last commit (print template instead of toybuf).Rob Landley
Also, xstrdup() the unmodified template because changing the environment string could make the changed version show up in "ps".
2015-02-11Only apply mktemp directory to targets that aren't already paths.Rob Landley
2015-02-10Fix longopts (pointed out by Hyejin Kim).Rob Landley
2015-02-07Shameless meddling.Rob Landley
2015-02-07Use $TMPDIR if set (necessary on Android, where there is no /tmp).Elliot Hughes
Include full template in error messages. Don't report success on failure with -q. Avoid unnecessary allocation. Fix "xxxxxx" versus "XXXXXX" confusion.
2014-12-02Don't mount a filesystem over an existing one with the same /dev and /dir.Rob Landley
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...)
2014-11-25Update dmesg, loosely based on a patch from Elliott Hughes.Rob Landley
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.
2014-11-19Make md5sum and sha1sum work on big endian systems.0.5.1Rob Landley
2014-11-19probe for getspnam(), forkpty(), utmpx, replace sethostname()Isaac Dunham
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.
2014-10-09Various bugfixes (mostly resource leaks) from Ashwini Sharma's static ↵Rob Landley
analysis, plus occasional tweak by me while reviewing them.
2014-09-28Fix two mount bugs: 1) Don't skip a filesystem type when setting up loopback ↵Rob Landley
mount, 2) Don't stop checking filesystem types due to EBUSY, it may mean already mounted by another filesystem type you haven't tried yet.
2014-09-28mount: terminate list so unknown user mount attempts don't endlessly loop, ↵Rob Landley
add better error reporting.
2014-09-26Separate more commands so single.sh can build them standalone.Rob Landley
2014-09-22When killall was invoked without arguments, there appeared segmentation fault?ukasz Szpakowski
2014-09-14Split xpopen() into xpopen_both(), xpopen(), and xrun() depending on whether ↵Rob Landley
we want to redirect both, one, or neither of stdin/stdout.
2014-09-07Promote mount. It's not perfect, but it basically works now.Rob Landley
2014-08-24Work in progress snapshot of mount, with fallout to umount. (Not done yet.)Rob Landley
2014-07-05Try to lookup all umounts in /proc/mounts so we can auto-zap loopback devices.Rob Landley
2014-06-07Make md5sum/sha1sum -b flag be "brief" output (just the hash).Rob Landley
(It's not like systems implementing -b binary and -t text still matter.)
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-15Here's a quick cleanup of md5sum. Executive summary: smaller and faster.Daniel Verkamp
On my machine, for a 2.2 GB file of random bytes, the timings with warm cache are: toybox before: 11.4 seconds toybox after: 8.3 seconds GNU md5sum: 3.9 seconds openssl dgst -md5: 3.5 seconds This is clearly better than before (3x openssl), but still slow (2x openssl). I suspect there is more low-hanging fruit to be had by eliminating the memcpy in hash_update (maybe not too much - hash_update accounts for about 4% of total runtime versus 92% for md5_transform according to perf - but this would also help sha1sum). make bloatcheck on x86_64 gcc 4.8.2 -Os: name old new delta ----------------------------------------------------------------------- md5rot 0 64 64 md5_transform 365 223 -142 ----------------------------------------------------------------------- -78 total Rationale for the changes: Move definition of 'rol' up so it can be used in md5_transform. This is purely cosmetic; it expands to exactly the same code. Put rotation counts in a lookup table instead of calculating them on the fly. This is mostly a wash size-wise, +5 bytes total, but worthwhile for readability and speed. Instead of accessing the state array using a rotating index (the variable formerly known as 'a'), access the state with constant offsets and rotate the contents of the array instead. This is the big win - it eliminates all the crazy memory addressing math inside the loop.