Commit graph

28 commits

Author SHA1 Message Date
Elliott Hughes
88f0f4b2b4 Revert "Switch to toybox ls."
This reverts commit 9c94aa9982.

Change-Id: Ie2479ee4a0614e285ce8d57c727200a0381904e2
2015-05-16 06:28:10 +00:00
Elliott Hughes
9c94aa9982 Switch to toybox ls.
Bug: http://b/21171466
Change-Id: I3fa09db7ca43d337cbda60f10269e7607544982b
2015-05-15 16:54:35 -07:00
Elliott Hughes
cf5f9b99cb Move ls implementation detail into ls.
Also remove the unused generality, and remove a dependency on a linux/
header file when there's a sys/ one that's even better.

Change-Id: If07608cc9ae2b7c2928ee2a9e33d20d63a9a8f45
2015-04-08 11:38:16 -07:00
Elliott Hughes
fd4c6b0a3a Refresh toolbox.
Use more upstream NetBSD, and update those things that were already NetBSD.

Note that unlike bionic, the upstream-netbsd directory isn't pristine; we have
changes marked by __ANDROID__.

Bug: 16493461
Change-Id: I99762bfe02caa0945ea4a184670888a4b5435a1d
2014-07-24 17:20:51 -07:00
Mark Salyzyn
aa907768af toolbox: turn on -Werror
- Deal with some signedness issues
- Deal with some size issues
- Deal with NULL pointer issues
- Deal with some -Wunused issues

Change-Id: I1479dd90d690084491bae3475f2c547833519a57
2014-05-14 12:41:24 -07:00
Mark Salyzyn
4727c7711e toolbox: ls: 64 bit compile warnings
Change-Id: Ia538c7177f8d5cf2c1f0efb5b575da6527c13968
2014-03-14 13:47:16 -07:00
Elliott Hughes
ccecf14254 system/core 64-bit cleanup.
This cleans up most of the size-related problems in system/core.
There are still a few changes needed for a clean 64-bit build,
but they look like they might require changes to things like the
fastboot protocol.

Change-Id: I1560425a289fa158e13e2e3173cc3e71976f92c0
2014-01-16 12:54:18 -08:00
William Roberts
ded3464a10 toolbox-ls: re-introduce clobbered error message
commit 403b1955 clobbered the error message on lstat()
calls.

Change-Id: Idbd24b648e3a85079b8f8541c0798bf944485ca1
2014-01-03 02:52:34 +00:00
Nick Kralevich
8dfdf650ab Minor cleanups.
Use ssize_t for handling the result of a readlink call.

Fix the following compiler warning:

  system/core/toolbox/ls.c: In function 'listfile_maclabel':
  system/core/toolbox/ls.c:238:68: warning: unused parameter 'flags' [-Wunused-parameter]
   static int listfile_maclabel(const char *path, struct stat *s, int flags)

Change-Id: Idd65f3349fb9dfb6f7a374c81f72d3169af33505
2013-11-27 16:12:48 -08:00
Nick Kralevich
4ec2910fb6 Increase buffer size, use bounds checking functions
Increase the size of the user/group buffer from 16 bytes
to 32 bytes. Some OEMs are creating usernames longer than
15 bytes, causing problems.

Use bounds checking functions when handling user/group
data, to avoid overflowing buffers.

Change-Id: I4a5824b819b0c37662ba4f33573af0d0e071b444
2013-11-27 15:47:16 -08:00
William Roberts
403b195548 Add -i option to toolbox cmd ls
Change-Id: I4690fc10dc07bf1883bcf8ec18399235dc97d317
2013-04-03 17:39:19 -07:00
Kenny Root
b83c09812f Remove HAVE_SELINUX guards
Change-Id: Idef0a784a1d237257ff4135bb1df62ff8a67ded3
2012-10-16 12:34:06 -07:00
Kenny Root
ef5d0340e4 toolbox: silence some compiler warnings
Comparison of signed and unsigned integers. Use parenthesis around a
group of bitwise OR operations.

Change-Id: Ia404380593ce2c2a291133c07c0fc7a016a3ad3f
2012-10-10 11:28:27 -07:00
Stephen Smalley
8290d1083e Extend toolbox with SE Android support.
Add -Z option to ls and ps for displaying security contexts.
Modify id to display security context.
Add new SELinux commands: chcon, getenforce, getsebool, load_policy, restorecon, runcon, setenforce, setsebool.

Change-Id: Ia20941be4a6cd706fe392fed6e38a37d880ec5f1
2012-02-03 11:11:15 -05:00
Kenny Root
070ec8e02e resolved conflicts for merge of 3ea075be to honeycomb-plus-aosp
Change-Id: Ic668cb99822d4bc44f2f57782afd1a6c1b348e9b
2011-07-15 11:20:14 -07:00
Kenny Root
40dac65941 Add -F for classify to ls
Adds a field to the non-long version of ls that tells what type of file
it is (i.e., regular, directory, link, fifo, etc).

This is useful for scripts that don't have direct filesystem access.

Change-Id: I54a327390f6ed403acb13c824f62ba9594ba320d
2011-07-13 17:53:50 -07:00
David 'Digit' Turner
a8d1afb3e9 toolbox: make getprop print a sorted list of properties
This patch also factors out the dynarray_t/strlist_t code
from ls.c and moves it to dynarray.[hc].

Change-Id: Ifae2b364d7c2733aad5551ad3c78ae72f8ac31f4
2011-01-08 12:22:08 +01:00
Brad Fitzpatrick
e7fe5bf3ac Add ls -n to toolbox.
Change-Id: I641f9504554d14fb1289ac470e6e61c5bc12e9c7
2010-10-25 13:30:41 -07:00
Kenny Root
0b1ff6be08 am eb42170e: Display file sizes larger than 2GB correctly
Merge commit 'eb42170e6c8b70f11dca9965785aa04a80290c72' into gingerbread-plus-aosp

* commit 'eb42170e6c8b70f11dca9965785aa04a80290c72':
  Display file sizes larger than 2GB correctly
2010-06-25 09:50:08 -07:00
Kenny Root
eb42170e6c Display file sizes larger than 2GB correctly
File size was cast to a signed integer which displayed files over 2GB as
negative sizes on devices. Use a long long for printing instead which
matches the stat struct.

Change-Id: I0ec07f33716bb4c2e5d120633ed435f637238f46
2010-06-25 09:08:05 -07:00
The Android Open Source Project
7c84efe083 merge from open-source master
Change-Id: I2f725ca20bf08748a4b3e81a4e98fbe08fcf1a47
2010-06-09 07:16:49 -07:00
David 'Digit' Turner
aa2106b008 toolbox-ls: sort file and directory lists
Sorts file and directory names properly in 'ls'
+ accept group flags (e.g. '-ld' instead of '-l -d')
+ accept flags in any position on the command line (e.g. 'ls foo -l' works)

Change-Id: Idc24a69ae31fe0c13726d39892357ac89a8830db
2010-06-04 10:44:56 -07:00
Andy McFadden
9feee025a0 Fix up ls -s.
Added the "total" line, which makes it easy to answer questions like,
"how the hell much space am I wasting on /data/dalvik-cache?".

Also fixed the -s filename output, which was showing mostly-full paths
when a simple filename was called for.
2009-09-27 15:13:56 -07:00
Andy McFadden
327e696808 Added -s flag to ls.
This may not be useful, and may actually be misleading since yaffs2
doesn't track the blocks used for each file (it just divides the length
down by 512).  I'm submitting it because yaffs2 isn't the only
filesystem we'll ever use.

I also changed some sprintf to snprintf, mostly out of paranoid habit.
2009-08-18 11:10:03 -07:00
Andy McFadden
b33d3415b6 AI 145220: Added "-d" flag to ls.
Now you can "ls -l -d <directory>" to see directory perms.

Automated import of CL 145220
2009-04-08 19:25:35 -07:00
The Android Open Source Project
dd7bc3319d auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
The Android Open Source Project
e54eebbf1a auto import from //depot/cupcake/@135843 2009-03-03 18:29:04 -08:00
The Android Open Source Project
4f6e8d7a00 Initial Contribution 2008-10-21 07:00:00 -07:00