Author: ngie
Date: Sun Sep 18 05:10:15 2016
New Revision: 305918
URL: https://svnweb.freebsd.org/changeset/base/305918

Log:
  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
  
  MFC after:    1 week
  X-MFC with:   r305916
  Sponsored by: Dell EMC Isilon

Modified:
  head/tests/sys/mac/bsdextended/matches_test.sh

Modified: head/tests/sys/mac/bsdextended/matches_test.sh
==============================================================================
--- head/tests/sys/mac/bsdextended/matches_test.sh      Sun Sep 18 05:07:18 
2016        (r305917)
+++ head/tests/sys/mac/bsdextended/matches_test.sh      Sun Sep 18 05:10:15 
2016        (r305918)
@@ -36,9 +36,11 @@ if ! sysctl -N security.mac.bsdextended 
        echo "1..0 # SKIP mac_bsdextended(4) support isn't available"
        exit 0
 fi
-if ! chmod -Rf 0755 $TMPDIR; then
-       echo "1..0 # SKIP failed to chmod $TMPDIR"
-       exit 0
+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"
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to