From f66471456d93b61c335c761d3bcaff7a3f2d591d Mon Sep 17 00:00:00 2001 From: ngie Date: Fri, 21 Oct 2016 08:25:03 +0000 Subject: [PATCH] MFstable/11 r307715: MFC r305916,r305918: r305916: Make sure $TMPDIR is created with 0755 permissions This is required to ensure that the temporary script can be executed, as the default mode is apparently too restrictive r305918: Only chmod $TMPDIR if it's not /tmp This is a safety belt to ensure that the /tmp sticky bit stuff doesn't get whacked by accident if someone runs the script outright git-svn-id: svn://svn.freebsd.org/base/stable/10@307716 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- tests/sys/mac/bsdextended/matches_test.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/sys/mac/bsdextended/matches_test.sh b/tests/sys/mac/bsdextended/matches_test.sh index 11cac8123..929bbca2f 100644 --- a/tests/sys/mac/bsdextended/matches_test.sh +++ b/tests/sys/mac/bsdextended/matches_test.sh @@ -36,6 +36,12 @@ if ! sysctl -N security.mac.bsdextended >/dev/null 2>&1; then echo "1..0 # SKIP mac_bsdextended(4) support isn't available" exit 0 fi +if [ "$TMPDIR" != "/tmp" ]; then + if ! chmod -Rf 0755 $TMPDIR; then + echo "1..0 # SKIP failed to chmod $TMPDIR" + exit 0 + fi +fi if ! playground=$(mktemp -d $TMPDIR/tmp.XXXXXXX); then echo "1..0 # SKIP failed to create temporary directory" exit 0 -- 2.45.0