From owner-svn-src-all@freebsd.org Wed May 31 21:16:11 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 A17F6B94A66; Wed, 31 May 2017 21:16:11 +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 6E91C68A3D; Wed, 31 May 2017 21:16:11 +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 v4VLGAYH048486; Wed, 31 May 2017 21:16:10 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4VLGAiP048485; Wed, 31 May 2017 21:16:10 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201705312116.v4VLGAiP048485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Wed, 31 May 2017 21:16:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r319357 - stable/11/share/mk X-SVN-Group: stable-11 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: Wed, 31 May 2017 21:16:11 -0000 Author: vangyzen Date: Wed May 31 21:16:10 2017 New Revision: 319357 URL: https://svnweb.freebsd.org/changeset/base/319357 Log: MFC r319022 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. Sponsored by: Dell EMC Modified: stable/11/share/mk/bsd.init.mk Directory Properties: stable/11/ (props changed) Modified: stable/11/share/mk/bsd.init.mk ============================================================================== --- stable/11/share/mk/bsd.init.mk Wed May 31 21:15:05 2017 (r319356) +++ stable/11/share/mk/bsd.init.mk Wed May 31 21:16:10 2017 (r319357) @@ -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