Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 May 2017 21:16:10 +0000 (UTC)
From:      Eric van Gyzen <vangyzen@FreeBSD.org>
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
Message-ID:  <201705312116.v4VLGAiP048485@repo.freebsd.org>

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



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