pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkgsrc-created user and group ids

2010/1/21 Larson, Timothy E. <>
> > > (I am not subscribed to this list, so please cc me in replies.)
> > >
> > > I'm using pkgsrc on NetBSD. ÂI'd like pkgsrc-created user and
> > group
> > > ids to lie in a particular interval. Â(That way, for example, I
> > can
> > > avoid overlap in pkg_comp chroots between the host environment's
> > ids
> > > and the chroot environment's ids.) ÂI can do this for user ids by
> > > putting `range a..b' in /etc/usermgmt.conf, but I see no obvious
> > way
> > > to make this work for group ids.
> >
> > You can do that now with NetBSD-current where Michael van Elst
> > enhanced
> > it to also have a range for group ids.
> Is there a way to tell pkgsrc to do this generally, or is it OS-specific?

One OS independent way to do this might be (slightly tweaked version
of something that has been suggested before)

- Add pkgsrc/defaults/users & pkgsrc/defaults/groups which contain
lines of username:uid and groupname:gid respectively

- If a package defines PKG_USERS or PKG_GROUPS and matches the
username or groupname in the, use the uid/gid

- Otherwise pick the uid/gid as now (but show a warning for pkglint)

It also has the advantage that if two packages both need a user then
they will always get the same uid no matter which order they are
installed (I find the current behaviour somewhat annoying on this)

One issue is finding free uid/gid ranges on each OS - my preferred
solution for this would be to store the uid/gid in the files based
from 1, and then set a per OS PKG_USERS_BASE_UID and

Of course, the above would need someone with the time to implement :/

Home | Main Index | Thread Index | Old Index