Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 May 2017 00:45:29 +0000 (UTC)
From:      Eric van Gyzen <vangyzen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r319022 - head/share/mk
Message-ID:  <201705280045.v4S0jTJj099174@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



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