ls -l on Android device
Tom Spear
speeddymon at gmail.com
Fri Jan 8 13:13:58 UTC 2010
On Fri, Jan 8, 2010 at 1:28 AM, Denys Vlasenko <vda.linux at googlemail.com> wrote:
> On Fri, Jan 8, 2010 at 6:48 AM, Mike Frysinger <vapier at gentoo.org> wrote:
>> On Friday 08 January 2010 00:19:39 Tom Spear wrote:
>>> On Thu, Jan 7, 2010 at 11:11 PM, Mike Frysinger wrote:
>>> > On Thursday 07 January 2010 23:24:14 Tom Spear wrote:
>>> >> more importantly, no /etc, so there is no passwd file for performing uid
>>> >> to user name mappings etc.
>>> >
>>> > busybox doesnt query any /etc/ file directly so it doesnt care (ignoring
>>> > the loginutils that manage the files). that is up to the C library to
>>> > manage.
>>>
>>> Unless I'm missing something, this comment in procps/ps.c says it does
>>> care about passwd:
>>>
>>> /* TODO: get_cached_username() returns numeric string if
>>> * user has no passwd record, we will display it
>>> * left-justified here; too long usernames are shown
>>> * as _right-justified_ IDs. Is it worth fixing? */
>>>
>>> What did I miss?
>>
>> a "passwd record" does not mean it needs /etc/passwd. read the busybox code
>> and you'll see that it does not parse /etc/passwd directly in any way -- it's
>> using the standard functions C library functions to get records. if you dig
>> far enough, you end up at libbb/bb_pwd.c
>
> Well, if you selected
>
> CONFIG_USE_BB_PWD_GRP=y
> CONFIG_USE_BB_SHADOW=y
>
> in your .config, then bbox will use internal version of getpwnam() and such.
> So, try switching that off.
>
> And anyway, can you post exact command you run, its output, and how it differs
> from "standard" command's output?
> --
> vda
>
Ok, here is what I ran and it's output on my linux machine:
[root at linux-slut apps]# id
uid=0(root) gid=0(root)
groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)
context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[root at linux-slut apps]# ls -l
total 1956
drwxrwxr-x. 2 tom tom 4096 2010-01-07 23:48 apk
drwxr-xr-x. 32 tom tom 4096 2010-01-08 06:37 busybox-1.15.3
-rw-rw-r--. 1 tom tom 1987727 2010-01-01 07:20 busybox-1.15.3.tar.bz2
drwxrwxr-x. 2 tom tom 4096 2010-01-07 21:14 MTBrowser
That's using the normal Fedora coreutils. Using busybox, I get the
same output for ls -l and:
[root at linux-slut busybox-1.15.3]# ./busybox id
uid=0(root) gid=0(root)
groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)
Using toolbox (the Android coreutils) on my phone I get:
# ls -l /data
drwxr-x--- root log 2009-12-28 06:24 dontpanic
drwx------ system system 2010-01-07 21:19 backup
drwxrwx--x system system 2010-01-07 13:40 data
drwxrwx--x system system 2010-01-07 21:19 dalvik-cache
drwxrwx--x system system 2010-01-07 13:43 app
drwxrwx--x system system 2010-01-07 13:43 app-private
drwxrwx--x system system 2010-01-07 13:44 anr
drwxrwx--x shell shell 2010-01-06 21:50 local
drwxrwx--t system misc 2010-01-04 20:19 misc
drwxr-xr-x system system 2009-12-07 07:15 tombstones
drwx------ root root 2010-01-07 09:31 property
drwxrwxr-x system system 2010-01-08 06:49 system
-rw-rw-rw- root root 8 2010-01-08 07:10 cc_data
drwxrwx--- root root 1969-12-31 18:06 lost+found
# exit
$ id
uid=2000(shell) gid=2000(shell)
groups=1003(graphics),1004(input),1007(log),1011(adb),1015(sdcard_rw),3001(net_bt_admin),3002(net_bt),3003(inet)
Using busybox on my phone with the CONFIG_USE_BB_PWD_GRP and
CONFIG_USE_BB_SHADOW options enabled OR disabled does not matter:
# ./busybox ls -l /data
drwxrwx--x 1 1000 1000 2048 Jan 7 19:44 anr
drwxrwx--x 1 1000 1000 2048 Jan 7 19:43 app
drwxrwx--x 1 1000 1000 2048 Jan 7 19:43 app-private
drwx------ 1 1000 1000 2048 Jan 8 03:19 backup
-rwxr-xr-x 1 0 0 2357531 Jan 8 12:37 busybox
-rw-rw-rw- 1 0 0 8 Jan 8 12:55 cc_data
drwxrwx--x 1 1000 1000 2048 Jan 8 03:19 dalvik-cache
drwxrwx--x 1 1000 1000 2048 Jan 7 19:40 data
drwxr-x--- 1 0 1007 2048 Dec 28 12:24 dontpanic
drwxrwx--x 1 2000 2000 2048 Jan 7 03:50 local
drwxrwx--- 1 0 0 2048 Jan 1 1970 lost+found
drwxrwx--t 1 1000 9998 2048 Jan 5 02:19 misc
drwx------ 1 0 0 2048 Jan 7 15:31 property
drwxrwxr-x 1 1000 1000 2048 Jan 8 12:49 system
drwxr-xr-x 1 1000 1000 2048 Dec 7 13:15 tombstones
# exit
$ ./busybox id
uid=2000 gid=2000 groups=1003,1004,1007,1011,1015,3001,3002,3003
More information about the busybox
mailing list