pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk Introduce _SU_ROOT_USER, which can be used for part...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/819b4ae50e18
branches:  trunk
changeset: 519758:819b4ae50e18
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Mon Oct 09 10:30:27 2006 +0000

description:
Introduce _SU_ROOT_USER, which can be used for partially unprivileged
builds, when the normal ROOT_USER overrides should happen, but
su-target is still desired to work.

diffstat:

 mk/bsd.pkg.mk |  11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diffs (40 lines):

diff -r cb6c18d8820f -r 819b4ae50e18 mk/bsd.pkg.mk
--- a/mk/bsd.pkg.mk     Mon Oct 09 08:57:39 2006 +0000
+++ b/mk/bsd.pkg.mk     Mon Oct 09 10:30:27 2006 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.pkg.mk,v 1.1885 2006/10/03 14:22:16 gdt Exp $
+#      $NetBSD: bsd.pkg.mk,v 1.1886 2006/10/09 10:30:27 joerg Exp $
 #
 # This file is in the public domain.
 #
@@ -86,6 +86,9 @@
 SVR4_PKGNAME?=         ${PKGNAME}
 WRKSRC?=               ${WRKDIR}/${DISTNAME}
 
+# Override for SU_CMD user check
+_SU_ROOT_USER?=                ${ROOT_USER}
+
 .if (defined(INSTALL_UNSTRIPPED) && !empty(INSTALL_UNSTRIPPED:M[yY][eE][sS])) || defined(DEBUG_FLAGS)
 _INSTALL_UNSTRIPPED=   # set (flag used by platform/*.mk)
 .endif
@@ -695,7 +698,7 @@
        "")     ;;                                                      \
        *)      ${PRE_CMD.su-${.TARGET}} ;;                             \
        esac;                                                           \
-       if ${TEST} `${ID} -u` = `${ID} -u ${ROOT_USER}`; then           \
+       if ${TEST} `${ID} -u` = `${ID} -u ${_SU_ROOT_USER}`; then       \
                ${_ROOT_CMD};                                           \
        else                                                            \
                case ${PRE_ROOT_CMD:Q}"" in                             \
@@ -703,9 +706,9 @@
                *) ${WARNING_MSG} "Running: "${PRE_ROOT_CMD:Q} ;;       \
                esac;                                                   \
                ${PRE_ROOT_CMD};                                        \
-               ${STEP_MSG} "Becoming \`\`${ROOT_USER}'' to make su-${.TARGET} (`${ECHO} ${SU_CMD} | ${AWK} '{ print $$1 }'`)"; \
+               ${STEP_MSG} "Becoming \`\`${_SU_ROOT_USER}'' to make su-${.TARGET} (`${ECHO} ${SU_CMD} | ${AWK} '{ print $$1 }'`)"; \
                ${SU_CMD} ${_ROOT_CMD:Q};                               \
-               ${STEP_MSG} "Dropping \`\`${ROOT_USER}'' privileges.";  \
+               ${STEP_MSG} "Dropping \`\`${_SU_ROOT_USER}'' privileges.";      \
        fi
 
 ################################################################



Home | Main Index | Thread Index | Old Index