[Toybox] [PATCH] bufgetgrgid: fix for very large groups.

enh enh at google.com
Mon Jul 2 11:19:48 PDT 2018


On Sat, Jun 30, 2018 at 10:12 PM Rob Landley <rob at landley.net> wrote:
>
> On 06/30/2018 09:45 PM, Rob Landley wrote:
> > Sigh, but I might as well keep the two functions matching in case I do work out
> > a way to collapse them together later.
>
> Question, which requires some context first:
>
> I've been triaging pending/ and looking at the 4
> groupadd/groupdel/useradd/userdel commands, which use lib/password.c.
> Specifically, they use code that parses /etc/passwd and /etc/shadow files, which
> android doesn't have.
>
> Way back when busybox had its own code to read/write these files without
> depending on libc to do it, then Kyungwan Han and Ashwini Sharma sent me a lot
> of code to do this sort of thing, much of it at least stylistically copying
> busybox. And way back when the bionic stubs for the user account functions
> returned variants of "not implemented", so doing it directly made sense at the time.
>
> Now android has its own user account stuff, in some sort of database last I
> checked, so using the libc functions makes sense. And this thread is about a
> google patch making more complete use of the libc functions, so...
>
> Is there a way I can implement userdel/passwd/su and so on that will be of use
> to android, or should I stick with the /etc/files approach and assume that I'm
> running in a container that a range of UIDs and GIDs have been delegated to and
> I'm just locally managing them for a build environment?

on Android "users" correspond to components/apps, so, no there's no
obvious sensible interpretation of userdel/passwd.

Android has an `su` that's basically `sudo`. i don't think there's
anything Android-specific in there right now. but CTS explicitly
disallows shipping with `su` or `sudo`.

`run-as` is the more Android-specific `sudo` (specifically because a
Unix "user" is really an "app"). that _is_ allowed, and is needed to
run various debugging tools in the appropriate app context. but that's
99% calls to libpackagelistparser, so it wouldn't make sense in
toybox.

> Rob



More information about the Toybox mailing list