pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk Enable fake home directory support. Also add a wrkr...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/3ac18a008ded
branches:  trunk
changeset: 538493:3ac18a008ded
user:      tnn <tnn%pkgsrc.org@localhost>
date:      Sun Feb 10 11:43:20 2008 +0000

description:
Enable fake home directory support. Also add a wrkref check because an
embedded path to the HOME directory can be a security problem if, say,
the package looks in the HOME directory of an unprivileged user for
configuration files.

Note that this has the potential to cause some short-term fallout.

diffstat:

 mk/bsd.pkg.mk            |  11 ++++++++++-
 mk/check/check-wrkref.mk |   8 +++++---
 2 files changed, 15 insertions(+), 4 deletions(-)

diffs (68 lines):

diff -r b9f7f4922a20 -r 3ac18a008ded mk/bsd.pkg.mk
--- a/mk/bsd.pkg.mk     Sun Feb 10 10:30:58 2008 +0000
+++ b/mk/bsd.pkg.mk     Sun Feb 10 11:43:20 2008 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.pkg.mk,v 1.1936 2008/02/07 21:36:13 rillig Exp $
+#      $NetBSD: bsd.pkg.mk,v 1.1937 2008/02/10 11:43:20 tnn Exp $
 #
 # This file is in the public domain.
 #
@@ -453,6 +453,15 @@
 #
 .include "compiler.mk"
 
+#Fake up a home directory
+WRAPPER_TARGETS+=      fake-home
+FAKEHOMEDIR=           ${WRKDIR}/.home
+ALL_ENV+=              HOME=${FAKEHOMEDIR}
+.PHONY: fake-home
+fake-home: ${FAKEHOMEDIR}
+${FAKEHOMEDIR}:
+       ${RUN} ${MKDIR} ${.TARGET}
+
 .include "wrapper/bsd.wrapper.mk"
 
 .if defined(ABI_DEPENDS) || defined(BUILD_ABI_DEPENDS)
diff -r b9f7f4922a20 -r 3ac18a008ded mk/check/check-wrkref.mk
--- a/mk/check/check-wrkref.mk  Sun Feb 10 10:30:58 2008 +0000
+++ b/mk/check/check-wrkref.mk  Sun Feb 10 11:43:20 2008 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: check-wrkref.mk,v 1.16 2008/02/07 21:36:13 rillig Exp $
+# $NetBSD: check-wrkref.mk,v 1.17 2008/02/10 11:43:20 tnn Exp $
 #
 # This file checks that the installed files don't contain any strings
 # that point to the directory where the package had been built, to make
@@ -11,6 +11,7 @@
 #      The list of directory names that must not appear in installed files.
 #
 #      * "tools" for the tool wrapper directory
+#      * "home" for FAKEHOMEDIR
 #      * "wrksrc" for WRKSRC
 #      * "work" for WRKDIR
 #      * "wrkobjdir" for WRKOBJDIR
@@ -37,7 +38,7 @@
 _PKG_VARS.check-wrkref=                CHECK_WRKREF_SKIP
 
 .if defined(PKG_DEVELOPER)
-CHECK_WRKREF?=         tools
+CHECK_WRKREF?=         tools home
 .endif
 CHECK_WRKREF?=         no
 CHECK_WRKREF_SKIP?=    # none
@@ -47,6 +48,7 @@
 _CHECK_WRKREF_DIR.no=          # none
 _CHECK_WRKREF_DIR.work=                ${WRKDIR}
 _CHECK_WRKREF_DIR.tools=       ${TOOLS_DIR}
+_CHECK_WRKREF_DIR.home=                ${FAKEHOMEDIR}
 _CHECK_WRKREF_DIR.wrkobjdir=   ${WRKOBJDIR}
 _CHECK_WRKREF_DIR.wrksrc=      ${WRKSRC}
 _CHECK_WRKREF_DIR.pkgsrc=      ${PKGSRCDIR}
@@ -56,7 +58,7 @@
 .for d in ${CHECK_WRKREF}
 .  if !defined(_CHECK_WRKREF_DIR.${d})
 PKG_FAIL_REASON+=      "[check-wrkref.mk] Invalid value "${d:Q}" for CHECK_WRKREF."
-PKG_FAIL_REASON+=      "[check-wrkref.mk] Try one of { tools wrksrc work objwrkdir } instead."
+PKG_FAIL_REASON+=      "[check-wrkref.mk] Try one of { tools home wrksrc work objwrkdir } instead."
 .  else
 _CHECK_WRKREF_DIRS+=   ${_CHECK_WRKREF_DIR.${d}}
 .  endif



Home | Main Index | Thread Index | Old Index