From owner-freebsd-ports@FreeBSD.ORG Wed Dec 7 20:42:57 2011 Return-Path: Delivered-To: ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E29F6106564A for ; Wed, 7 Dec 2011 20:42:57 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id 0974A8FC08 for ; Wed, 7 Dec 2011 20:42:56 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.4/8.14.4) with ESMTP id pB7K6Ooj049887; Wed, 7 Dec 2011 14:06:24 -0600 (CST) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.4/8.14.4/Submit) id pB7K6OLf049886; Wed, 7 Dec 2011 14:06:24 -0600 (CST) (envelope-from brooks) Date: Wed, 7 Dec 2011 14:06:24 -0600 From: Brooks Davis To: Chris Rees Message-ID: <20111207200624.GA49137@lor.one-eyed-alien.net> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="k+w/mQv8wyuph6w0" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: ports@freebsd.org Subject: Re: Creation of users in ports X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2011 20:42:58 -0000 --k+w/mQv8wyuph6w0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 07, 2011 at 07:54:07PM +0000, Chris Rees wrote: > Hi all, >=20 > I'm at a loss as to how to restore functionality for creating (or > using) customised users in ports. For example, using the old method > (pkg-install scripts) many ports allowed the user to change the > username used for the port. >=20 > With the new functionality, if the username isn't found in > /usr/ports/UIDs it's rejected, and the port can't use it. >=20 > Can anyone explain to me why it would be a bad idea to include the > system's passwd and group files in the search? This would allow the > ports system to accept any user that already exists, as well as > creating the correct code in the plist. >=20 > For example; someone wants to install postgresql as username Fred, so > s/he sets PG_USER=3DFred in /etc/make.conf. Currently this causes an > error on build, because Fred is not in /usr/ports/UIDs. Were > /etc/master.passwd and /etc/group searched too, that wouldn't cause a > problem. >=20 > Any obvious oversights? It seems like a better (but more complicatd) solution would use "getent passwd ${USER}" to check for existing users. (You need to check explicitly rather than treating the output without /etc/passwd because some nss modules don't enumerate to avoid listing the thousands or tens of thousands of users in a corporate AD or LDAP installation). -- Brooks --k+w/mQv8wyuph6w0 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFO38c/XY6L6fI4GtQRAsP+AKCl5aoa8BRLH4hoVZOPKOj6B987IACggG3f Cty7VoE7HUGtNNZ8X1LAPBs= =4HRm -----END PGP SIGNATURE----- --k+w/mQv8wyuph6w0--