ls -l on Android device

Tom Spear speeddymon at gmail.com
Fri Jan 8 05:19:39 UTC 2010


On Thu, Jan 7, 2010 at 11:11 PM, Mike Frysinger <vapier at gentoo.org> wrote:
> On Thursday 07 January 2010 23:24:14 Tom Spear wrote:
>
> please dont top post in your replies
>
>> Busybox calls get_cached_username() on line 779 of coreutils/ls.c
>>
>> Bionic has no get_cached_username() function itself, but their shell
>> calls getpwuid() to perform the name lookup.
>
> i dont think you dug deep enough.  get_cached_username() is an internal
> busybox function.
>
>> The reason for this is that the Android OS is not a fully functional GNU or
>> even POSIX compliant linux system, it has no libc, and
>
> the GNU issue isnt important as busybox doesnt require it.  the POSIX one
> might be.
>
>> 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.
> -mike
>

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?

Tom


More information about the busybox mailing list