diff options
author | vangyzen <vangyzen@FreeBSD.org> | 2017-05-31 21:16:10 +0000 |
---|---|---|
committer | vangyzen <vangyzen@FreeBSD.org> | 2017-05-31 21:16:10 +0000 |
commit | c4ad2d6e883ea33557bfd13e1c60b85f3978d74d (patch) | |
tree | a76519dbb4ea98009232529fe638da6c05332a2a /share | |
parent | b6940fdb9ca213809f16974fbd80d083b52e934b (diff) | |
download | FreeBSD-src-c4ad2d6e883ea33557bfd13e1c60b85f3978d74d.zip FreeBSD-src-c4ad2d6e883ea33557bfd13e1c60b85f3978d74d.tar.gz |
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
Diffstat (limited to 'share')
-rw-r--r-- | share/mk/bsd.init.mk | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/share/mk/bsd.init.mk b/share/mk/bsd.init.mk index 2877999..bab4e23 100644 --- a/share/mk/bsd.init.mk +++ b/share/mk/bsd.init.mk @@ -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 |