From owner-freebsd-ports@FreeBSD.ORG Wed Oct 20 08:45:18 2010 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 C05A91065672 for ; Wed, 20 Oct 2010 08:45:18 +0000 (UTC) (envelope-from florent.thoumie@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 74CFB8FC19 for ; Wed, 20 Oct 2010 08:45:18 +0000 (UTC) Received: by qwe4 with SMTP id 4so2045607qwe.13 for ; Wed, 20 Oct 2010 01:45:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:sender:received :in-reply-to:references:from:date:x-google-sender-auth:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=4r6qslswoFcS+Bw95hyWoJirBZZSGlQxCCN+RUFAwxs=; b=VreMlHrom9KgA/6YL4IwZdgcBRDEcYS9T8YGEd9JsqPobT3VVQEYh243K4AWyV2pPZ ddgoeIrE0RLz8FPr2XOv5AoTeH0MjPN9y9mD37z0J864mOW+SW7x1otud8jOyDcPsOgg YaVf6VkhMXkIDI7J3hpiyChOVhOSuWy2oBLvk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=HPIaOc23AtyNRv+wgm/EoHdWtn5zJhk9zD82QhZ6hqA5qviQEWHGR6IjWXsYG2H+zm EWKnxVCdqchsFMcDK2OMX9g/5m8zk5PgTxRMGg0VTNHh+qSnAVEXkL1QNHzTkeA3VpzU 26hOR72/Mt5a20HPmnYfWhpF/RR7c46eqpZWk= Received: by 10.224.205.129 with SMTP id fq1mr3083981qab.83.1287562432824; Wed, 20 Oct 2010 01:13:52 -0700 (PDT) MIME-Version: 1.0 Sender: florent.thoumie@gmail.com Received: by 10.229.85.148 with HTTP; Wed, 20 Oct 2010 01:13:32 -0700 (PDT) In-Reply-To: <20101019174642.665f9ad3@eggman> References: <20101019174642.665f9ad3@eggman> From: Florent Thoumie Date: Wed, 20 Oct 2010 09:13:32 +0100 X-Google-Sender-Auth: SYVqNmEguvnUvO6N1GDNSLxb7lw Message-ID: To: Jason Helfman Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: ports@freebsd.org Subject: Re: issue with pkg_add 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, 20 Oct 2010 08:45:18 -0000 On Wed, Oct 20, 2010 at 1:46 AM, Jason Helfman wrote: > > Hi, > > I believe I may have come across a potential bug in pkg_add, but wanted > to write my findings out to see if anyone has seen this issue, or knows > of something I may be doing wrong. > > I wrote a port that uses USERS/GROUPS functionality of ports. > > USERS=3D =A0 =A0 =A0 =A0 =A0user > GROUPS=3D =A0 =A0 =A0 =A0 user_work > BINOWN=3D =A0 =A0 =A0 =A0 user > BINGRP=3D =A0 =A0 =A0 =A0 user_work > BINMODE=3D =A0 =A0 =A0 =A04110 > > These are the exec lines in my +CONTENTS file (assume one line for > each exec, they were wrapped): > @exec if ! /usr/sbin/pw groupshow user_work >/dev/null 2>&1; > then /usr/sbin/pw groupadd user_work -g 999; fi > @exec if ! /usr/sbin/pw usershow user >/dev/null 2>&1; > then /usr/sbin/pw useradd user -u 999 -g 999 =A0-c "user" -d /home/user > -s /usr/sbin/nologin; fi > > I found that on my desktop with a ports tree installed that this port > and package installed with no issue, however I found that if I tried to > install the package in a jail with no ports tree and nothing installed > that it failed with this error: > > pw: group `999' does not exist > pkg_add: command 'if ! /usr/sbin/pw usershow user >/dev/null 2>&1; then /= usr/sbin/pw useradd user -u 999 -g 999 =A0-c "user" -d /home/user -s /usr/s= bin/nologin; fi' failed You may want to run pkg_add -v and see if the group is created properly by the preceding @exec line and if not, why. > I removed all remnants of the installation (these packages were all > successful builds in Tinderbox), including installed users/groups. I > copied my UIDs and GIDs files to an empty /usr/ports directory. So the > only files under /usr/ports were UIDs and GIDs. > > With these files in place, I reran the pkg_add command on the port > package I created and it installed the user and group with no issue, > with correct permissions and modes on the files. > > With this testing, it appears that pkg_add is looking > at /usr/ports/UIDs and /usr/ports/GIDs for information on installing a > port package, even-though all of the information required for an > installation appears to be in my port package. > > Has anyone run into this issue? Any assumptions I am making? Any flawed > logic in testing? I haven't tried to install packages in a jail lately but having written the USERS/GROUPS logic in bsd.port.mk, the package shouldn't need a ports tree to be installed properly. --=20 Florent Thoumie flz@FreeBSD.org FreeBSD Committer