[PATCH] make system uid/gid range configurable
Tito
farmatito at tiscali.it
Mon May 11 06:31:33 UTC 2009
On Monday 11 May 2009 03:14:50 Denys Vlasenko wrote:
> On Tuesday 05 May 2009 23:22, Tito wrote:
> > Hi,
> > this patch makes FIRST_SYSTEM_UID, LAST_SYSTEM_UID, FIRST_SYSTEM_GID, LAST_SYSTEM_GID
> > used by adduser and addgroup --system configurable to allow different values
> > for exotic systems like the Android Dev 1 Phone.
> > The patch was tested a little for the Config part and compile tested for adduser and addgroup.
> > The Config system gurus maybe could take a look at the relevant Config part as
> > i did it by intuition ;-) (was not able to find docs about it....).
> >
> > Ciao,
> > TIto
> >
> > --- busybox.orig/loginutils/Config.in 2009-04-23 14:54:09.000000000 +0200
> > +++ busybox/loginutils/Config.in 2009-05-05 21:51:15.000000000 +0200
> > @@ -152,6 +152,22 @@
> > help
> > Support long options for the adduser applet.
> >
> > +config FIRST_SYSTEM_ID
> > + int "First valid system uid or gid for adduser and addgroup"
> > + depends on ADDUSER || ADDGROUP
> > + range 0 LAST_SYSTEM_ID
> > + default 100
> > + help
> > + First valid system uid or gid for adduser and addgroup
> > +
> > +config LAST_SYSTEM_ID
> > + int "Last valid system uid or gid for adduser and addgroup"
> > + depends on ADDUSER || ADDGROUP
> > + range FIRST_SYSTEM_ID 64999
> > + default 999
> > + help
> > + Last valid system uid or gid for adduser and addgroup
>
> I propose having just FIRST_SYSTEM_ID. What is the rationale for
> having configurable LAST_SYSTEM_ID? I don't see any.
>
> Care to re-do the patch?
> --
> vda
>
Hi,
I read in the man page for adduser:
" adduser will choose the first available UID from the range specified
for normal users in the configuration file."
The range for normal users is is after the range for system users
so a LAST_SYSTEM_ID value is needed.
What i see on my debian box is:
1) hardcoded values 0 - 99
2) system users 100 - 999
3) normal users 1000 - 29999
Even in more exotic platforms like android you'll find the same grouping:
1) 0 - 999 reserved - unused
2) 1000 - 9999 system users hardcoded in the headers
3) >= 10000 dynamically allocated uids
So I plead for the survival of LAST_SYSTEM_ID.
If the default values set in the Config file are sane
most users don't need to touch it anyway, but the few
that need to adapt bb on particular platforms
don't need to patch the source.
The 64999 could be changed tough to 65535
if you want as pointed out by Mike Frysinger,
must be changed also in adduser and addroup
source.
Ciao,
Tito
More information about the busybox
mailing list