summaryrefslogtreecommitdiff
path: root/mk/bsd.pkg.mk
diff options
context:
space:
mode:
authortnn <tnn@pkgsrc.org>2008-02-10 11:43:20 +0000
committertnn <tnn@pkgsrc.org>2008-02-10 11:43:20 +0000
commitd91ec324820c4d8023d83a29d25c494f0a0befb1 (patch)
tree266666676361d034fbf2da40600a58efbcdb7796 /mk/bsd.pkg.mk
parent0f1f94115c56e374f36306cd8201abcecf10b506 (diff)
downloadpkgsrc-d91ec324820c4d8023d83a29d25c494f0a0befb1.tar.gz
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 (limited to 'mk/bsd.pkg.mk')
-rw-r--r--mk/bsd.pkg.mk11
1 files changed, 10 insertions, 1 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk
index 4244561da1f..84dc7fa2bd6 100644
--- a/mk/bsd.pkg.mk
+++ b/mk/bsd.pkg.mk
@@ -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 @@ USE_LANGUAGES?= # empty
#
.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)