Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/make/unit-tests Do not assume /tmp is safe to use if...
details: https://anonhg.NetBSD.org/src/rev/d8c2eb4dd508
branches: trunk
changeset: 984338:d8c2eb4dd508
user: sjg <sjg%NetBSD.org@localhost>
date: Sun Jul 04 01:28:54 2021 +0000
description:
Do not assume /tmp is safe to use if TMPDIR is set
diffstat:
usr.bin/make/unit-tests/objdir-writable.exp | 2 +-
usr.bin/make/unit-tests/objdir-writable.mk | 11 ++++++-----
2 files changed, 7 insertions(+), 6 deletions(-)
diffs (41 lines):
diff -r 9a216ab66e2c -r d8c2eb4dd508 usr.bin/make/unit-tests/objdir-writable.exp
--- a/usr.bin/make/unit-tests/objdir-writable.exp Sat Jul 03 22:39:40 2021 +0000
+++ b/usr.bin/make/unit-tests/objdir-writable.exp Sun Jul 04 01:28:54 2021 +0000
@@ -1,5 +1,5 @@
make warning: TMPDIR/roobj: Permission denied.
-/tmp
+TMPDIR
TMPDIR/roobj
TMPDIR/roobj
exit status 0
diff -r 9a216ab66e2c -r d8c2eb4dd508 usr.bin/make/unit-tests/objdir-writable.mk
--- a/usr.bin/make/unit-tests/objdir-writable.mk Sat Jul 03 22:39:40 2021 +0000
+++ b/usr.bin/make/unit-tests/objdir-writable.mk Sun Jul 04 01:28:54 2021 +0000
@@ -1,8 +1,9 @@
-# $NetBSD: objdir-writable.mk,v 1.4 2020/11/14 07:36:00 sjg Exp $
+# $NetBSD: objdir-writable.mk,v 1.5 2021/07/04 01:28:54 sjg Exp $
# test checking for writable objdir
-RO_OBJDIR?= ${TMPDIR:U/tmp}/roobj
+TMPDIR?= /tmp
+RO_OBJDIR?= ${TMPDIR}/roobj
.if make(do-objdir)
# this should succeed
@@ -20,12 +21,12 @@
@rmdir ${RO_OBJDIR}
no-objdir:
- @MAKEOBJDIR=${RO_OBJDIR} ${.MAKE} -r -f /dev/null -C /tmp -V .OBJDIR
+ @MAKEOBJDIR=${RO_OBJDIR} ${.MAKE} -r -f /dev/null -C ${TMPDIR} -V .OBJDIR
ro-objdir:
- @MAKEOBJDIR=${RO_OBJDIR} ${.MAKE} -r -f /dev/null -C /tmp -V .OBJDIR MAKE_OBJDIR_CHECK_WRITABLE=no
+ @MAKEOBJDIR=${RO_OBJDIR} ${.MAKE} -r -f /dev/null -C ${TMPDIR} -V .OBJDIR MAKE_OBJDIR_CHECK_WRITABLE=no
explicit-objdir:
- @MAKEOBJDIR=/tmp ${.MAKE} -r -f ${MAKEFILE:tA} -C /tmp do-objdir -V .OBJDIR
+ @MAKEOBJDIR=${TMPDIR} ${.MAKE} -r -f ${MAKEFILE:tA} -C ${TMPDIR} do-objdir -V .OBJDIR
.endif
Home |
Main Index |
Thread Index |
Old Index