From owner-freebsd-www@FreeBSD.ORG Sun Sep 2 16:05:38 2012 Return-Path: Delivered-To: www@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 93261106564A; Sun, 2 Sep 2012 16:05:38 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from onyx.glenbarber.us (onyx.glenbarber.us [IPv6:2607:fc50:1000:c200::face]) by mx1.freebsd.org (Postfix) with ESMTP id 5F1278FC0A; Sun, 2 Sep 2012 16:05:38 +0000 (UTC) Received: from glenbarber.us (75.97.141.105.res-cmts.sewb.ptd.net [75.97.141.105]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: gjb) by onyx.glenbarber.us (Postfix) with ESMTPSA id 43F5423F645; Sun, 2 Sep 2012 12:05:35 -0400 (EDT) Date: Sun, 2 Sep 2012 12:05:33 -0400 From: Glen Barber To: www@FreeBSD.org Message-ID: <20120902160512.GE1266@glenbarber.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="PW0Eas8rCkcu1VkF" Content-Disposition: inline X-Operating-System: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Subject: [RFC] WEBGRP/CGIGRP chgrp(1) fix for web build X-BeenThere: freebsd-www@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD Project Webmasters List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Sep 2012 16:05:38 -0000 --PW0Eas8rCkcu1VkF Content-Type: multipart/mixed; boundary="t4apE7yKrX2dGgJC" Content-Disposition: inline --t4apE7yKrX2dGgJC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, Currently, the web build sets WEBGRP=www and CGIGRP=www if otherwise not set. The problem is that if $USER is not in the www group and UID != 0, the chgrp(1) call fails. This is a problem for users that do not already know these need to be set if the build is executed as non-root user because the point of failure is too far into the build process. The attached patch sets WEBGRP=$USER and CGIGRP=$USER if the UID is not zero, unless explicitly set by the user. Are there any objections to me committing this change? Thanks in advance. Glen --t4apE7yKrX2dGgJC Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="web.site.mk.diff.UID.txt" Content-Transfer-Encoding: quoted-printable Index: head/share/mk/web.site.mk =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- head/share/mk/web.site.mk (revision 39491) +++ head/share/mk/web.site.mk (working copy) @@ -19,12 +19,23 @@ CGIDIR?=3D ${.CURDIR:T} DESTDIR?=3D ${HOME}/public_html =20 +_ID?=3D /usr/bin/id +_UID!=3D ${_ID} -u + WEBOWN?=3D ${USER} +.if (${_UID} > 0) +WEBGRP?=3D ${USER} +.else WEBGRP?=3D www +.endif WEBMODE?=3D 664 =20 CGIOWN?=3D ${USER} +.if (${_UID} > 0) +CGIGRP?=3D ${USER} +.else CGIGRP?=3D www +.endif CGIMODE?=3D 775 =20 BUNZIP2?=3D /usr/bin/bunzip2 --t4apE7yKrX2dGgJC-- --PW0Eas8rCkcu1VkF Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQEcBAEBCAAGBQJQQ4PNAAoJEFJPDDeguUajbp8H/13UVnCtn0qWl3fnXbdEcBOq mArfqFchIexzKz8ViVf9dR+oQyeYCoAjyzG4yS6kg+AP1rxABZRQxNej5zmQf67E tRLnud3ZNYhJTKkNmW3pDMY5yh3VOI9AMMK+sjKt0nj3MxA3o1SFoVdW7WPAmZQg vo82xkSrpBAejSeVbL8ppyqRZc1bJmhqFXgS0hKN7FxPcNwoaJyDUKa7MFLRjaoN bSa/q6nyIQM/O38ljsoMg5BpzD9iD1L1a5Z0p2tnhQ8CQO9LQvbsFohVD9CZUJfo xd3HXPUeLiq+sxFXuJSSei53+BxCmbiGi6FzEpIMJpVeQHPkgaR5ncNhRz+BkBE= =LDRS -----END PGP SIGNATURE----- --PW0Eas8rCkcu1VkF--