tech-pkg archive

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

Re: Chaging uid/gid at binary install



On Mon, 21 Feb 2011 00:08:06 +0900, Masao Uebayashi 
<uebayasi%tombi.co.jp@localhost> wrote:

On Sun, Feb 20, 2011 at 05:08:14PM +0900, OBATA Akio wrote:
On Sun, 20 Feb 2011 13:14:17 +0900, Masao Uebayashi 
<uebayasi%tombi.co.jp@localhost> wrote:

>OpenBSD Ports has this:
>
>http://www.openbsd.org/cgi-bin/cvsweb/ports/infrastructure/db/user.list

About UID, it is possible to fix for OpenBSD ports, but not for pkgsrc,
because followings are system environment depend values.
1. free UID range
2. builtin users list

Do you mean, "builtin users list" == UIDs which OSes provide by
default?

Can we provide a pre-defined pkgsrc username/UID "range"?

For example, if I set PKG_UID_RANGE=500-999 and install foo-1.2.3
which needs user "_foo" which has pkgsrc UID index 50, pkg_add(8)
will useradd(8) user "_foo" as 550 and chown files.

Does this sound reasonable?

I feel so.

For Darwin, with useradd from sysutils/user_darwin:
1. using uid 300-399 range, because usual users are >=500 and Fink using >=400.
2. try to assign uid same as gid, if it is free.
3. try to assign lowest free uid in the range.

So I propose followings (for users, same as groups)
1. all users/groups variables is in one file,
    same as user customizable variables are in mk/defaults/mk.conf.
2. Each users may have weak suggested uid offset index.
3. introduce PKG_UID_RANGE, default value is set by OPSYS basis,
   but user customizable.
4. (start of PKG_UID_RANGE) + (suggested uid offset) = proposed uid
5. if the user already exists, DONA (if primary group is mismatch, add to the 
group though)
6. If proposed uid is already used, search free uid from PKG_UID_RANGE
   by reverse order.

--
OBATA Akio / obache%NetBSD.org@localhost


Home | Main Index | Thread Index | Old Index