From owner-svn-src-head@freebsd.org Sun May 28 00:45:30 2017 Return-Path: Delivered-To: svn-src-head@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 39E5BD76FC6; Sun, 28 May 2017 00:45:30 +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 0A1F91004; Sun, 28 May 2017 00:45:29 +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 v4S0jTaO099175; Sun, 28 May 2017 00:45:29 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S0jTJj099174; Sun, 28 May 2017 00:45:29 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201705280045.v4S0jTJj099174@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:45:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319022 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 00:45:30 -0000 Author: vangyzen Date: Sun May 28 00:45:28 2017 New Revision: 319022 URL: https://svnweb.freebsd.org/changeset/base/319022 Log: Fix INSTALL_AS_USER with external nsswitch databases The INSTALL_AS_USER option tells "install" to use the current user name as the owner of the installed file. The "install" command executed by the build is statically linked, so it does not load nsswitch modules, such as nss_ldap.so, so it fails when the user is only defined in such a database. Fix it to use the current UID instead of user name. This works for all users. I expect it is also slightly more efficient. Reviewed by: sjg MFC after: 3 days Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D10862 Modified: head/share/mk/bsd.init.mk Modified: head/share/mk/bsd.init.mk ============================================================================== --- head/share/mk/bsd.init.mk Sun May 28 00:45:02 2017 (r319021) +++ head/share/mk/bsd.init.mk Sun May 28 00:45:28 2017 (r319022) @@ -24,20 +24,12 @@ _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} +$xOWN= ${_uid} $xGRP= ${_gid} .endfor .endif