Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Sep 2012 12:05:33 -0400
From:      Glen Barber <gjb@FreeBSD.org>
To:        www@FreeBSD.org
Subject:   [RFC] WEBGRP/CGIGRP chgrp(1) fix for web build
Message-ID:  <20120902160512.GE1266@glenbarber.us>

next in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120902160512.GE1266>