From owner-freebsd-ports@FreeBSD.ORG Sat Feb 22 19:25:14 2014 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ABC227B8 for ; Sat, 22 Feb 2014 19:25:14 +0000 (UTC) Received: from smtp.infracaninophile.co.uk (smtp6.infracaninophile.co.uk [IPv6:2001:8b0:151:1:3cd3:cd67:fafa:3d78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4849E15B4 for ; Sat, 22 Feb 2014 19:25:14 +0000 (UTC) Received: from seedling.black-earth.co.uk (seedling.black-earth.co.uk [81.2.117.99]) (authenticated bits=0) by smtp.infracaninophile.co.uk (8.14.8/8.14.8) with ESMTP id s1MJOpYq099918 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Sat, 22 Feb 2014 19:25:03 GMT (envelope-from m.seaman@infracaninophile.co.uk) DKIM-Filter: OpenDKIM Filter v2.8.3 smtp.infracaninophile.co.uk s1MJOpYq099918 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=infracaninophile.co.uk; s=201001-infracaninophile; t=1393097103; bh=IxLyN0zL+HxC57jwuyxxNWYOZGuj9wWQ57oU9RVql5E=; h=Date:From:To:Subject:References:In-Reply-To; z=Date:=20Sat,=2022=20Feb=202014=2019:24:42=20+0000|From:=20Matthew =20Seaman=20|To:=20freebsd-ports@ freebsd.org|Subject:=20Re:=20Changing=20ownership=20of=20a=20direc tory=20when=20using=20staging|References:=20<20140222190540.GA9375 @apnoea.adamw.org>|In-Reply-To:=20<20140222190540.GA9375@apnoea.ad amw.org>; b=CdykW26uu3jfk3hbh5ilkzWyReg5QpsOoyifsEFrP9QSShJTnzzNVhJmfhxe/pPnw yR1QAufpeFmrPk/FbSMz12CEM+q+EUx5p8KmOvNr3JOGtLTcj3CAH72KrsWwHaV5/a OgZBpddzfISXrCwIworRpY5IZHI0UYB5NzeObZbw= Message-ID: <5308F97A.3050405@infracaninophile.co.uk> Date: Sat, 22 Feb 2014 19:24:42 +0000 From: Matthew Seaman User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: freebsd-ports@freebsd.org Subject: Re: Changing ownership of a directory when using staging References: <20140222190540.GA9375@apnoea.adamw.org> In-Reply-To: <20140222190540.GA9375@apnoea.adamw.org> X-Enigmail-Version: 1.6 OpenPGP: id=E7F39EBF Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="d14mTMGEwSu2NthHgwgI5hHABEspUcOgN" X-Virus-Scanned: clamav-milter 0.98.1 at lucid-nonsense.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lucid-nonsense.infracaninophile.co.uk X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Feb 2014 19:25:14 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --d14mTMGEwSu2NthHgwgI5hHABEspUcOgN Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 22/02/2014 19:05, Adam Weinberger wrote: > How do I specify the owner/group and mode of a directory when using > staging? It appears to automatically create every directory as > root:wheel. Setting @user/@group in pkg-plist doesn't affect things wit= h > @exec mkdir. >=20 > The only thing I can figure is: > @exec install -d -m 730 -o user -g group %D/path/to/dir >=20 > But that'll fail when installed by anyone except root, right? >=20 > This problem breaks usability of a number of ports---especially > web-based ones where specific directories need specific owners. Every > time www/dokuwiki is upgraded or reinstalled, a half dozen directories > have to be manually chown'd on the command line, for example. I had this with www/rt42 with the ${LOCALBASE}/etc/rt directory -- here's the solution I used in pkg-plist: @mode 0440 etc/rt42/RT_Config.pm @unexec if cmp -s %D/etc/rt42/RT_SiteConfig.pm-dist %D/etc/rt42/RT_SiteConfig.pm ; then rm -f %D/etc/rt42/RT_SiteConfig.pm; f= i etc/rt42/RT_SiteConfig.pm-dist @exec [ -f %B/RT_SiteConfig.pm ] || cp -p %D/%F %B/RT_SiteConfig.pm @mode etc/rt42/acl.Oracle etc/rt42/acl.Pg etc/rt42/acl.mysql etc/rt42/initialdata etc/rt42/schema.Oracle etc/rt42/schema.Pg etc/rt42/schema.SQLite etc/rt42/schema.mysql @exec chmod 0750 %D/etc/rt42 @exec chgrp rt %D/etc/rt42 @group Would be nicer to create the directory with the right ownership and mode in the first place, then copy the files to it, but that doesn't seem to work given what you can go with a plist. Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. PGP: http://www.infracaninophile.co.uk/pgpkey JID: matthew@infracaninophile.co.uk --d14mTMGEwSu2NthHgwgI5hHABEspUcOgN Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.20 (Darwin) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQJ8BAEBCgBmBQJTCPmDXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2NTNBNjhCOTEzQTRFNkNGM0UxRTEzMjZC QjIzQUY1MThFMUE0MDEzAAoJELsjr1GOGkATpVYP/0521srXJ1F78I2oIMjeIHWJ 0CKqHhmd+f7N4nPv7ZQDvqgEZxHk2hP7LdZPY0Phwz+ei1zpxJZVtJ1HNt/8I6rb 0iXMfdeaxRD8hEDHJmUSgIqnCHANLDRGWQByPga+4XvRKdqtAfjg8g108XV7MjiY +ysCFCd0R+mXd+c7Xo0ZWxA5lhXt9bQDigoPviIYpP7SksIXgy4gPUpjP7Qb4vkI YHZ3tutzmjgU0hl4oZlxfxd17NksbxOgnUIP11K9OUwsu31+7/EmF6sxpI5ub6si LgJpOKu58L0hqZ9qxz+heTFWaEGgZv3NcwaXCoYcdfwhZTVTp8/rLmZyZ6U6ENoK no5xce51EmXU15bSiv7mJlQ/+MEUCPBW40qqu5wa7T0dRIw4hARFeVNwF6/QNQpc 3Pxk3jw+QlZ5ocd0nyqKsjVagCKvbx4B/sPfJzuazXc1P2NEHVhu58w5zI//0SIP TPx0hMo9ZfP3RztNootVHGCxYiP34Jr8rGCif5zxJKvblIipHUVD5DDFEhqRODPq 2emjsWBa0J4tt1e3ZQaHlVtZyvFOLPs4IaqPBDxQf1UvXuxL/i++9b2ym/sytYr7 bx29Mjc+8uNLvpzpt5kdDSBH2RoukmQVGU5yPc0kRv8HlXctb+4QEAL7sPvB3bc8 WuphRq6UNoVHnuMb5X3S =vYZf -----END PGP SIGNATURE----- --d14mTMGEwSu2NthHgwgI5hHABEspUcOgN--