From owner-freebsd-ports@FreeBSD.ORG Wed Dec 7 20:10:13 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 59160106564A; Wed, 7 Dec 2011 20:10:13 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id BFC308FC17; Wed, 7 Dec 2011 20:10:12 +0000 (UTC) Received: by eaai12 with SMTP id i12so1109756eaa.13 for ; Wed, 07 Dec 2011 12:10:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=VykRIiVrrhxvxMWOi9jcGbxpyEognGkK3UnbzSCiqVI=; b=bhFakDgKTaibklln52GFTHqSBFe3TFAINENp3Bvm9bKa109KYD9RsV2FUHLXlph9T3 YOyqyn16RsMlaj0RtqM/Uw8NVlyenjRGlVlq4xtieWL5x8DtcmIKQ2yGILPUsv3eyNND br0tL15CSBi4wro8rgJbmJF1FozYXhbMr2pKI= Received: by 10.50.169.33 with SMTP id ab1mr494839igc.0.1323288611301; Wed, 07 Dec 2011 12:10:11 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.167.83 with HTTP; Wed, 7 Dec 2011 12:09:40 -0800 (PST) In-Reply-To: <20111207200624.GA49137@lor.one-eyed-alien.net> References: <20111207200624.GA49137@lor.one-eyed-alien.net> From: Chris Rees Date: Wed, 7 Dec 2011 20:09:40 +0000 Message-ID: To: Brooks Davis Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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:10:13 -0000 On 7 December 2011 20:06, Brooks Davis wrote: > On Wed, Dec 07, 2011 at 07:54:07PM +0000, Chris Rees wrote: >> Hi all, >> >> I'm at a loss as to how to restore functionality for creating (or >> using) customised users in ports. =A0For example, using the old method >> (pkg-install scripts) many ports allowed the user to change the >> username used for the port. >> >> With the new functionality, if the username isn't found in >> /usr/ports/UIDs it's rejected, and the port can't use it. >> >> 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. >> >> For example; someone wants to install postgresql as username Fred, so >> s/he sets PG_USER=3DFred in /etc/make.conf. =A0Currently this causes an >> error on build, because Fred is not in /usr/ports/UIDs. =A0Were >> /etc/master.passwd and /etc/group searched too, that wouldn't cause a >> problem. >> >> Any obvious oversights? > > It seems like a better (but more complicatd) solution would use "getent > passwd ${USER}" to check for existing users. =A0(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). Oops, there's the obvious problem :) Thanks. Hm, getent will need some sed magic to change to master.passwd style, or we could change UIDs to use passwd style.... Chris