History log of /external/toybox/toys/posix/ls.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
08db7e5f4f47288bb467a8ec980fb361d234bc87 21-Jan-2016 Elliott Hughes <enh@google.com> Disable CFG_TOYBOX_DEBUG for now.

We turned on CFG_TOYBOX_DEBUG so ls would be asan-clean, but that turns out
to have broken mount for non-root users. So let's turn CFG_TOYBOX_DEBUG off
for now, but let's also say that ls should always be asan-clean on Android.

Bug: http://b/26647560
Change-Id: I5392aedd168c1e765e3319e3c76e996040b7e8ab
/external/toybox/toys/posix/ls.c
7d6f210aa38afe2a9a370f1e0f23edf72a1735bb 15-Jan-2016 Rob Landley <rob@landley.net> Command line files without paths were attempting to use stdin as their dirfd,
(because ls uses nonstandard directory recursion which collates all the
command line arguments under a fake top node, which needs more thorough
initialization).
/external/toybox/toys/posix/ls.c
0229ee428b00857b7978be1aae957839e8f00ca3 09-Jan-2016 Elliott Hughes <enh@google.com> The sense of -L was flipped.
/external/toybox/toys/posix/ls.c
d3a435e53c94ec25b4ae5fa2614f49ef8884e08a 06-Jan-2016 Rob Landley <rob@landley.net> Add error_msg_raw() and friends, replace error_msg("%s", s) uses, enable format
checking, and fix up format checking complaints.

Added out(type, value) function to stat to avoid a zillion printf typecasts.
/external/toybox/toys/posix/ls.c
3a70500a4b11623651d1ffd779592a521e5c738b 30-Dec-2015 Rob Landley <rob@landley.net> make "ls -m | cat" assume 80 columns.
/external/toybox/toys/posix/ls.c
047bcb8e7d37847b96dbf621ea22ff00e9541d32 12-Dec-2015 Rob Landley <rob@landley.net> Add a useless memset (under CFG_TOYBOX_DEBUG) to shut up valgrind.

Valgrind complains that we add uninitalized memory to totals[] fields we never
read from. (If we didn't set it in entrylen() we don't use it during display,
they're testing the same flags), but valgrind doesn't understand that.
/external/toybox/toys/posix/ls.c
d336af4180542c9d526dece02d1a27232ef1ca6a 07-Dec-2015 Rob Landley <rob@landley.net> Rename dirtree->data to dirfd, and don't store symlink length in it.
/external/toybox/toys/posix/ls.c
55aa28467914463e9c6869cd3c8b7264f7e6e695 28-Oct-2015 Rob Landley <rob@landley.net> Use the /proc/self/fd/%d workaround for O_PATH not letting you read xattrs,
inspired by:
https://android-review.googlesource.com/#/c/152663/4/libc/bionic/fgetxattr.cpp
/external/toybox/toys/posix/ls.c
87f6a93fc594934b21fcd0e9d42baad2abb209ae 28-Oct-2015 Rob Landley <rob@landley.net> Fix ls error message for chmod -r directories.

Also, if you mkdir "$(echo -e "one\ntwo"); chmod -r one*; ls -q one*
it honors -q.
/external/toybox/toys/posix/ls.c
091997e4c6f5655876a3133ae80b52c2d91a8216 05-Sep-2015 Elliott Hughes <enh@google.com> ls -h support.

It turns out that people are anticipating the switch to toybox ls from
toolbox ls on the assumption that this will finally bring -h support.
Let's not disappoint.

I've merged two existing buffers in listfiles whose uses didn't
overlap into one. It may be possible to cram this into toybuf with the
other stuff, but it didn't seem worth the extra complexity for 64B of
stack, especially since we were already living with that for time
formatting anyway.
/external/toybox/toys/posix/ls.c
b1b0399dc701f3c9af19a09164a4f536bc00eb2c 01-Sep-2015 Elliott Hughes <enh@google.com> ls -l user/group/security context should be left-aligned.

Right-aligned looks pretty good to me, but it's not what anyone else does.
/external/toybox/toys/posix/ls.c
3501e103b3b1f9d79f733976e338d59478d2e6f6 09-Aug-2015 Elliott Hughes <enh@google.com> Fix ls -l user/group field ordering.

It's user then group, not the other way round.
/external/toybox/toys/posix/ls.c
9acbbafefafbbb7b13bb15c1619e351f9b67a23d 23-Jun-2015 Rob Landley <rob@landley.net> Don't segfault if none of the file arguments to ls exists.
/external/toybox/toys/posix/ls.c
17a94c572a48a2268b9749055b6984cc63015965 23-Jun-2015 Rob Landley <rob@landley.net> Don't depend on malloc(0) to return non-null.
/external/toybox/toys/posix/ls.c
28727ba7cddb932bfa88eef514e60fe8d337087a 23-Jun-2015 Rob Landley <rob@landley.net> Fix ls so spacing is right for ls -l, -o, -g, -og, -ogZ, -lZ, -gZ, and -oZ.
/external/toybox/toys/posix/ls.c
a65a7f4241f1cc9b4963a285e3a2137cffae62ad 22-May-2015 Rob Landley <rob@landley.net> ls -lZ wasn't putting a space before the xattr output.
/external/toybox/toys/posix/ls.c
b031a3bc269e9cdb7bf307a757896b6ec7c4b3fe 19-May-2015 Rob Landley <rob@landley.net> Adapted patch from José Bollo to do the "tonight we're gonna api like
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.)
/external/toybox/toys/posix/ls.c
0cb5b70fa4ef093b08e59db813e73f3be6ecef4b 19-May-2015 Rob Landley <rob@landley.net> Switch id over to new infrastructure, switch id to use FORCE_FLAGS, and
make lib/lsm.h auto-include from toys.h.
/external/toybox/toys/posix/ls.c
821f31d237e0232c2810a5ed90889a1ea57134fb 18-May-2015 Rob Landley <rob@landley.net> Fix "ls -Z . toys" segfaulting, because preprocessing skipped.

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.
/external/toybox/toys/posix/ls.c
a8ee470ae3361bb8e6e364f0e8adf61259371e95 18-May-2015 Rob Landley <rob@landley.net> Recent commit broke ls -R (test reversed), and "ls -R singledir" should
show label: at the start (yes, even "ls -R" in an empty dir).
/external/toybox/toys/posix/ls.c
c565b06325960a16ebf44afd8ae73f363775e58d 18-May-2015 Rob Landley <rob@landley.net> More ls -Z upgrading. Move TOYBOX_SELINUX and TOYBOX_SMACK support from
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...
/external/toybox/toys/posix/ls.c
b18c7e8a59e61b8ec49e2d0f8cb2dda19b8f6a82 13-May-2015 Rob Landley <rob@landley.net> Fix bug (len[7] wasn't zeroed if -Z off, thus -C overestimated entry lengths),
and some cleanups while I was there.
/external/toybox/toys/posix/ls.c
1f5f436826505df6dfabe1de9724424fc40fae23 10-May-2015 Rob Landley <rob@landley.net> Cleanups of dirtree_start() calls. (Don't need to feed in flag values, just
symfollow true/false.)
/external/toybox/toys/posix/ls.c
aab9164df395a4b0878b0ad930a5ec8a806a58e9 10-May-2015 Rob Landley <rob@landley.net> Add DIRTREE_SHUTUP to disable dirtree warnings if file vanishes out from
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).
/external/toybox/toys/posix/ls.c
8565668d785d25f6dfd2dd19cece502cedf178b6 04-May-2015 Elliott Hughes <enh@google.com> Implement SELinux ls -Z support.

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.
/external/toybox/toys/posix/ls.c
5e18bae30a80d6149e47d9adb1acb3a64bac7c08 30-Apr-2015 Rob Landley <rob@landley.net> More ls cleanups from squinting at Jose's most recent smack patch.

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.)
/external/toybox/toys/posix/ls.c
491e3e3f1c654f689de0f8cbd3b05559fd65c568 30-Apr-2015 Rob Landley <rob@landley.net> Wild guess at cleaning up smack support. Don't have a test environment yet.
/external/toybox/toys/posix/ls.c
e94931034578707958fecb7f34dcd3a0a175eaf7 20-Oct-2014 Jan Cybulski <j.cybulski@samsung.com> ls: Add -Z (Smack) option

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>
/external/toybox/toys/posix/ls.c
2b8a6f636854e2b07c7ba9bedcbbd275e27b69bd 28-Apr-2015 Rob Landley <rob@landley.net> Fix ls -s and -i indentation in -C and -x modes. (Spotted by Jan Cybulski.)
/external/toybox/toys/posix/ls.c
30c36d87280f3c45db157056b94ff67922f03fbf 01-Mar-2015 Rob Landley <rob@landley.net> Patches from Elliott Hughes to fix various printf() format strings.

(Don't specify the space flag when it's the default behavior. The ifconfig
stuff was actual bugs.)
/external/toybox/toys/posix/ls.c
82671e1ed5f06e016398f3d2de5f3c2ba388713d 30-Oct-2014 Rob Landley <rob@landley.net> Test for ls -d from Isaac Dunham, and he pointed out -F also disables symlink following.
/external/toybox/toys/posix/ls.c
baa7f5cad548d8eceed45bebe4631f0e177bd8f0 30-Oct-2014 Rob Landley <rob@landley.net> Bug report from Isaac Dunham: ls -d shouldn't follow command line symlinks without -H or -L (just like ls -l).
/external/toybox/toys/posix/ls.c
44b89867e0bfc085083e17657697af74e273a534 03-Aug-2014 Rob Landley <rob@landley.net> Missed checking in dirtree_recurse() change (now needs specific DIRTREE_SYMFOLLOW value, not just true/false).
/external/toybox/toys/posix/ls.c
31db579265fa9e0acea036faa486be26f508e67a 21-Jul-2014 Rob Landley <rob@landley.net> Don't go into an endless loop if we hit a bad utf8 sequence without -q.
/external/toybox/toys/posix/ls.c
8fb779954829f923ee2935d81cd4446973aaa01f 20-Jul-2014 Rob Landley <rob@landley.net> Add utf8 support to ls -C.

Use wcwidth() instead of strlen(), and extend the -q substitution to also
whiteout nonprintable characters that are nonparseable utf8 snippets.
/external/toybox/toys/posix/ls.c
01f828d9d80ce2ad80e21638fece083f924318a9 03-Sep-2013 Rob Landley <rob@landley.net> Switch ls from utoa to sprintf.
/external/toybox/toys/posix/ls.c
408d4f2670df910180988747f11b6290551ddaa7 01-Sep-2013 Rob Landley <rob@landley.net> Implement ls --color=auto, suggested by Rich Felker.
/external/toybox/toys/posix/ls.c
b2bc38289143c52dee88ce3b0187aba091f668c6 02-Aug-2013 Rob Landley <rob@landley.net> ls --color should depend on LS in menuconfig.
/external/toybox/toys/posix/ls.c
876903c5e063431091fd3f9a2e01b496e88950d4 01-Jul-2013 Rob Landley <rob@landley.net> Make ls output major, minor for block devices.
/external/toybox/toys/posix/ls.c
12a4d74fb8813ad17a480732415d8ffc478d3ab3 01-Jul-2013 Rob Landley <rob@landley.net> First pass at ls --color
/external/toybox/toys/posix/ls.c
53b47708a7852dd9dc15b981888afec42cd0d591 30-Jun-2013 Rob Landley <rob@landley.net> Condense ls help text.
/external/toybox/toys/posix/ls.c
302d9d3e5138e950487dd22ab9e8b1d32a67456c 30-Jun-2013 Rob Landley <rob@landley.net> Fix another segfault in ls -C when terminal size is 0x0.
/external/toybox/toys/posix/ls.c
5a26a86cec424d728d43523988ca70aa56ee76c9 02-Jun-2013 Rob Landley <rob@landley.net> Stat cleanup.

lib: rename format_mode() to mode_to_string() (echoing string_to_mode), make it
take a normal char * argument.

stat: collapse big switch/case statements that only have one line each
into if/else staircase (much fewer lines of code). Remove return type
(other stat implementations print ? for unknown escapes, so do that here).
Inline do_stat() and do_statfs(). Set default string in normal local
variable "format". Remove unnecessary struct d. Restructure stat logic to
"if (flagf && !statfs()) else if (!flagf && !stat()) else perror_msg();"
Teach %N to add -> symlink. Judicious use of putchar() instead of xputc to
let FILE * do its job collating output.
/external/toybox/toys/posix/ls.c
5a221e6b84e9eab02e24ca541530e28eb7cfddac 22-Apr-2013 Felix Janda <felix.janda@posteo.de> Add library function for the file permission formatting in ls and stat
/external/toybox/toys/posix/ls.c
f02ca1e5d07157b66fde51068881611ab44cce68 27-Dec-2012 Rob Landley <rob@landley.net> A screen width of 1 is possible (in some weird setups), and gives ls -C a division by zero error.
/external/toybox/toys/posix/ls.c
3162c27324bb6a26cfb9e47b266d2a3ee451f47b 06-Dec-2012 Rob Landley <rob@landley.net> Have dirtree_add_node() set parent so error message can provide full path.
/external/toybox/toys/posix/ls.c
6093554a95fee1acd5b2aaad387b92fa4ae97d41 02-Dec-2012 Rob Landley <rob@landley.net> Minor whitespace tweak.
/external/toybox/toys/posix/ls.c
a5f8c733d478a57ad03c0b0efe7fa995e4c364a2 27-Nov-2012 Rob Landley <rob@landley.net> Squash "type punned pointer" nonsense with a bigger hammer. (Sheesh.)
/external/toybox/toys/posix/ls.c
7f909bd163630a2ce710653e0fafb7bae7171745 19-Nov-2012 Rob Landley <rob@landley.net> Teach option parsing about [groups] of related options.
/external/toybox/toys/posix/ls.c
02261e8082b9b098b20a4291fc2583f3c41db8d2 15-Nov-2012 Rob Landley <rob@landley.net> Make ls default to -C if no option specified and it's outputting to a tty.
/external/toybox/toys/posix/ls.c
7aa651a6a4496d848f86de9b1e6b3a003256a01f 14-Nov-2012 Rob Landley <rob@landley.net> Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.

The actual code should be the same afterward, this is just cosmetic refactoring.
/external/toybox/toys/posix/ls.c
c0e56edaf256adb6c60c5a052525a1ffbb927901 08-Oct-2012 Rob Landley <rob@landley.net> New build infrastructure to generate FLAG_ macros and TT alias, #define FOR_commandname before #including toys.h to trigger it. Rename DEFINE_GLOBALS() to just GLOBALS() (because I could never remember if it was DECLARE_GLOBALS). Convert existing commands to use new infrastructure, and replace optflag constants with FLAG_ macros where appropriate.
/external/toybox/toys/posix/ls.c
85dd282b08eb378b4b8cc275f96226dc2c151216 07-Sep-2012 Rob Landley <rob@landley.net> I screwed up ls in commit 580. Oops. Fix it.
/external/toybox/toys/posix/ls.c
f91b7c89bc852868692b9518185421ebb52d67b3 26-Aug-2012 Rob Landley <rob@landley.net> Regularize command headers, update links to standards documents.
/external/toybox/toys/posix/ls.c
3a9241add947cb6d24b5de7a8927517426a78795 25-Aug-2012 Rob Landley <rob@landley.net> Move commands into "posix", "lsb", and "other" menus/directories.
/external/toybox/toys/posix/ls.c