summaryrefslogtreecommitdiff
path: root/toys
AgeCommit message (Collapse)AuthorFilesLines
2015-07-02Cleanup xxd.Rob Landley1-47/+30
2015-07-02Minor cleanups on xxd.Rob Landley1-25/+10
2015-07-02The android guys sent in xxd. It doesn't share code with od and hexdump. Hmmm...Rob Landley1-0/+97
2015-07-01Improve -Z error reporting.Elliott Hughes3-3/+3
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-07-01Fix top.c build.Elliott Hughes1-9/+4
Broken by recent lib.h additions.
2015-06-29mkfifo -ZRob Landley1-2/+17
2015-06-28Add ionice and iorenice.Rob Landley1-0/+95
2015-06-27Add undo buffer for 'u'.Rob Landley1-8/+27
2015-06-27Simplify hexedit logic by adjusting viewport all in one place up top.Rob Landley1-60/+45
(Easier to genericize logic and reuse later in less or vi...)
2015-06-26Factor out more not-curses infrastructure into lib.Rob Landley1-65/+25
2015-06-23Don't segfault if none of the file arguments to ls exists.Rob Landley1-1/+2
2015-06-23Don't depend on malloc(0) to return non-null.Rob Landley1-1/+1
2015-06-23Fix ls so spacing is right for ls -l, -o, -g, -og, -ogZ, -lZ, -gZ, and -oZ.Rob Landley1-16/+15
2015-06-15Use lsm_set_create() to set security blanket context before mknod, avoidingRob Landley1-9/+5
racy gap between create/label.
2015-06-11Add nproc.Rob Landley1-0/+42
2015-06-06Last grep commit broke non -r use of grep. Oops.Rob Landley1-1/+1
2015-06-02Make "printf --" and "printf ---" work.Rob Landley1-1/+1
2015-05-31Move the magic list of commands needing cleanup from toys/pending/READMERob Landley10-10/+27
to greppable TODO annotations in the individual files. (grep -riw TODO)
2015-05-31On testing fold command, I found w option didnt check the range of value.Hyejin Kim1-1/+1
2015-05-31mknod: Add -Z optionJosé Bollo1-2/+19
Change-Id: I23174fb7b54d029784e6d7460368128113090079
2015-05-28Attempt to fix the mkdir LSM race.Rob Landley1-7/+3
Doing a world writeable mkdir and _then_ adding a label seems like a race window, so set the global "create stuff with these labels" context, then do the creates.
2015-05-21ls -lZ wasn't putting a space before the xattr output.Rob Landley1-1/+1
2015-05-21mkdir: Fix argument of option -ZJosé Bollo1-1/+1
2015-05-20Make "grep -r regex" work on implicit "." if no files specified.Rob Landley1-4/+4
2015-05-19Add -Z support to mkdir, based on a patch from Jose Bollo.Rob Landley1-2/+19
I have no idea why -Z isn't showing up in mkdir --help when enabled, I need to look at that...
2015-05-19Adapted patch from José Bollo to do the "tonight we're gonna api likeRob Landley1-11/+21
it's 1999 and every path ever is from cwd or root" api versions for sockets and as a fallback of the open fails. There are still some holes (symlink to socket with -L will give you info about the symlink, not the socket, and symlink to a file you can't open will give you info about the symlink, not the file) but the correct fix is to make O_PATH work in the kernel for the LSM functions. (If we can read this data by path, we should be able to read it by O_PATH. We should not need two codepaths for this.)
2015-05-18Switch id over to new infrastructure, switch id to use FORCE_FLAGS, andRob Landley2-32/+22
make lib/lsm.h auto-include from toys.h.
2015-05-18Fix "ls -Z . toys" segfaulting, because preprocessing skipped.Rob Landley1-1/+5
strwidth() got called on ->extra which was NULL. Had some other bad effects ala "ls -sk file1 file2 file3" ignored the -k. This should fix that too.
2015-05-18Recent commit broke ls -R (test reversed), and "ls -R singledir" shouldRob Landley1-2/+3
show label: at the start (yes, even "ls -R" in an empty dir).
2015-05-18More ls -Z upgrading. Move TOYBOX_SELINUX and TOYBOX_SMACK support fromRob Landley1-63/+46
portability.h to new lib/lsm.h. Update ls.c to use it. Fix "ls . toys" (two directories when one is . or ..), which was filtering out the . as something we shouldn't recurse into even though it was explicitly listed on the command line. For some reason "ls -Z . toys" is still segfaulting though (but "ls -Z ." isn't), need to figure out why...
2015-05-15stat: fix group nameJosé Bollo1-1/+1
Change-Id: I0ad65a40bf380d789c4396ebdc01be217901a2e3
2015-05-14Bugfix from Hyejin Kim: su should not prompt root user for new user's password.Rob Landley1-5/+7
2015-05-14Promote reset (actually write a new one using the simple man 4 console_codesRob Landley2-34/+23
terminal reset escape sequence) and add gettty() function to lib so terminal gets reset even when we redirect stdout/stderr. (This is apparently the expected behavior.)
2015-05-13Print name of file at the bottom of the screen.Rob Landley1-4/+40
And yes, I tested $PWD/私はガラスを食べられま す。それは私を傷つけません。 as a name and made it work. If you throw newlines or ascii escapes in the name it'll use the fancy printing logic for chars, otherwise it does the full utf8 fontmetrics deal.
2015-05-13More hexedit cursor boundary tweaking.Rob Landley1-10/+10
2015-05-13Fix bug (len[7] wasn't zeroed if -Z off, thus -C overestimated entry lengths),Rob Landley1-25/+9
and some cleanups while I was there.
2015-05-10Git hates me.Rob Landley1-0/+0
2015-05-10Cleanups of dirtree_start() calls. (Don't need to feed in flag values, justRob Landley4-8/+7
symfollow true/false.)
2015-05-09Add DIRTREE_SHUTUP to disable dirtree warnings if file vanishes out fromRob Landley7-40/+23
under traversal. Pass through full flag set in dirtree_add_node(), add dirtree_start() wrapper to provide symlink-only behavior (avoiding a lot of DIRTREE_SYMFOLLOW*!!(logic) repeated in callers).
2015-05-06Fix more with missing files.Elliott Hughes1-2/+4
Previously we'd go into an infinite loop because we weren't incrementing optargs. Also add a missing flush so an error on stderr won't overtake the escape code that resets reverse video. Disclaimer: the new behavior isn't exactly like the desktop version; surprisingly they try to open the next file _before_ they prompt. That feels weird to me as a user, and seems like it would lead to a more awkward implementation, but if you're more concerned about authenticity...
2015-05-06Re-enable catv command now that flag infrastructure is updated.Rob Landley1-19/+9
2015-05-04Implement SELinux ls -Z support.Elliott Hughes1-20/+38
This patch uses lgetfilecon rather than fgetfilecon because dirtree_parentfd always seems to return -1 in this function. If/when the SMACK code is fixed to work with dirtree_parentfd, I'll send a matching patch for SELinux. In the meantime, this works, and although ls -h is still on my to-do list, I think this patch is sufficient to let us replace toolbox ls with toybox ls.
2015-05-03Fix dmesg -c error output.Elliott Hughes1-1/+1
Use perror_exit to show the likely "Operation not permitted" if klogctl fails.
2015-05-03dhcpd writes leases on "dhcpd.leases" file.Hyejin Kim1-1/+1
but, dumpleases read from "udhcpd.leases".
2015-05-03Fix getprop sorting and error reporting.Elliott Hughes1-2/+2
Use qstrcmp instead of alphasort (which expects struct dirent arguments). Don't use perror_exit because property_list doesn't set errno.
2015-05-03Minor dmesg cleanup.Rob Landley1-15/+6
2015-05-02dmesg: add -t suppress timestamp flagMark Salyzyn1-6/+18
2015-04-30More ls cleanups from squinting at Jose's most recent smack patch.Rob Landley1-22/+17
Behavior change in flags: allow -long to work together, and -l1 work like -l not -1. I didn't make ls -gCl remember the g, though. (Because -Cg and -gC take the last one: I'll preserve explicit state but not implicit state. And if -1Cl and -lC1 aren't going to behave the same, it wasn't consistent anyway.)
2015-04-30Wild guess at cleaning up smack support. Don't have a test environment yet.Rob Landley1-32/+27
2015-04-29ls: Add -Z (Smack) optionJan Cybulski1-3/+42
Option triggers printing security context, for smack that is file's access smack label. Change-Id: I9054d9bcfe4d149e8fbfa0831b6ab50165d2bd91 Signed-off-by: Jan Cybulski <j.cybulski@samsung.com> Signed-off-by: José Bollo <jose.bollo@open.eurogiciel.org>