From owner-freebsd-ports@FreeBSD.ORG Wed Oct 20 01:05:44 2010 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 976F2106564A; Wed, 20 Oct 2010 01:05:44 +0000 (UTC) (envelope-from jhelfman@experts-exchange.com) Received: from mail.experts-exchange.com (mail.experts-exchange.com [72.29.183.251]) by mx1.freebsd.org (Postfix) with ESMTP id 76A378FC0C; Wed, 20 Oct 2010 01:05:44 +0000 (UTC) Received: from mail.experts-exchange.com (localhost [127.0.0.1]) by mail.experts-exchange.com (Postfix) with ESMTP id 914B9F2F1AB; Tue, 19 Oct 2010 17:49:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d= experts-exchange.com; h=content-transfer-encoding:content-type :content-type:mime-version:x-mailer:message-id:subject:subject :from:from:date:date:received:received; s=ee; t=1287535772; x= 1289350172; bh=O1cKw5VnfeMuYPY/9L+ZfkNJvhly7kJw0jrFCUDamC4=; b=B hgfYtAF7S5oZoTvqCVS6UajjQsgFxP5E1eU0beO+Rgnl0R/Ffi2nPj9iG3pZgX5p qYn+iQK4K+XqnuD3Xu6NX09psa7pQ+MqrhXGhRXMdmHsjV2oGJmANh5nOxztUGiz CtB0UE4RdPaUZ8xIwmD0unxaTfG0/SZrmljPK4uSpA= X-Virus-Scanned: amavisd-new at experts-exchange.com Received: from mail.experts-exchange.com ([127.0.0.1]) by mail.experts-exchange.com (mail.experts-exchange.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xBvUfERunJne; Tue, 19 Oct 2010 17:49:32 -0700 (PDT) Received: from eggman (unknown [192.168.103.122]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.experts-exchange.com (Postfix) with ESMTPS id 42A11F2F35E; Tue, 19 Oct 2010 17:49:32 -0700 (PDT) Date: Tue, 19 Oct 2010 17:46:42 -0700 From: Jason Helfman To: freebsd-ports@freebsd.org Message-ID: <20101019174642.665f9ad3@eggman> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; i386-portbld-freebsd7.3) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: ports@freebsd.org Subject: 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 01:05:44 -0000 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= user GROUPS= user_work BINOWN= user BINGRP= user_work BINMODE= 4110 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 -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 -c "user" -d /home/user -s /usr/sbin/nologin; fi' failed 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? Thanks, Jason