From owner-svn-src-all@freebsd.org Sun May 28 00:43:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07FB4D76EDE; Sun, 28 May 2017 00:43:14 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ABDCF1D5E; Sun, 28 May 2017 00:43:13 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4S0hCMA098947; Sun, 28 May 2017 00:43:12 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S0hCqh098945; Sun, 28 May 2017 00:43:12 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201705280043.v4S0hCqh098945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Sun, 28 May 2017 00:43:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319020 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 00:43:14 -0000 Author: vangyzen Date: Sun May 28 00:43:12 2017 New Revision: 319020 URL: https://svnweb.freebsd.org/changeset/base/319020 Log: Fix INSTALL_AS_USER Move INSTALL_AS_USER into bsd.init.mk to maximize the chance that it has final authority over fooOWN and fooGRP. Reviewed by: sjg MFC after: 3 days Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D10810 Modified: head/share/mk/bsd.init.mk head/share/mk/bsd.own.mk Modified: head/share/mk/bsd.init.mk ============================================================================== --- head/share/mk/bsd.init.mk Sun May 28 00:28:11 2017 (r319019) +++ head/share/mk/bsd.init.mk Sun May 28 00:43:12 2017 (r319020) @@ -16,6 +16,33 @@ ____: .include .MAIN: all +# Handle INSTALL_AS_USER here to maximize the chance that +# it has final authority over fooOWN and fooGRP. +.if ${MK_INSTALL_AS_USER} != "no" +.if !defined(_uid) +_uid!= id -u +.export _uid +.endif +.if ${_uid} != 0 +.if !defined(USER) +# Avoid exporting USER +.if !defined(_USER) +_USER!= id -un +.export _USER +.endif +USER= ${_USER} +.endif +.if !defined(_gid) +_gid!= id -g +.export _gid +.endif +.for x in BIN CONF DOC DTB INFO KMOD LIB MAN NLS SHARE +$xOWN= ${USER} +$xGRP= ${_gid} +.endfor +.endif +.endif + # Some targets need to know when something may build. This is used to # optimize targets that are only needed when building something, such as # (not) reading in depend files. For DIRDEPS_BUILD, it will only calculate Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Sun May 28 00:28:11 2017 (r319019) +++ head/share/mk/bsd.own.mk Sun May 28 00:43:12 2017 (r319020) @@ -135,31 +135,6 @@ CTFCONVERT_CMD= CTFCONVERT_CMD= @: .endif -.if ${MK_INSTALL_AS_USER} != "no" -.if !defined(_uid) -_uid!= id -u -.export _uid -.endif -.if ${_uid} != 0 -.if !defined(USER) -# Avoid exporting USER -.if !defined(_USER) -_USER!= id -un -.export _USER -.endif -USER= ${_USER} -.endif -.if !defined(_gid) -_gid!= id -g -.export _gid -.endif -.for x in BIN CONF DOC DTB INFO KMOD LIB MAN NLS SHARE -$xOWN= ${USER} -$xGRP= ${_gid} -.endfor -.endif -.endif - .endif # !_WITHOUT_SRCCONF # Binaries