svn commit: r319022 - head/share/mk
Eric van Gyzen
vangyzen at FreeBSD.org
Sun May 28 00:45:30 UTC 2017
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
More information about the svn-src-head
mailing list