Subject: PKG_USERS adding user but group doesn't exist
To: None <tech-pkg@netbsd.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: tech-pkg
Date: 08/20/2003 22:47:14
I was installing a package from my pkgsrc that had:

PKG_USERS=              ${MAN_DB_USER}:${ROOT_GROUP}::man-db\\ user
USE_PKGINSTALL=         YES

The ROOT_GROUP didn't exist so the useradd failed. And the "make
install" continued and many files didn't install because of missing user.

The mk/install/install code for PKG_GROUPS has:
                        # We need to check that ${PKG_GROUP} exists before
                        # adding the user.  Do it with chgrp to be able to
                        # use NIS.

I agree that the group should be checked before adding the user. But that
comment is in the add group section not the add user section.

I don't think we should assume that the group (defined in PKG_USERS)
exists. It should be checked and added if needed. Any comments?

(The code is already there, just needs a little reordering...)

   Jeremy C. Reed
   http://bsd.reedmedia.net/