From 3a5675480b1ac35c938a4776240b16c20ec134ff Mon Sep 17 00:00:00 2001 From: Ankush Patel Date: Tue, 17 Feb 2026 20:11:19 +1300 Subject: Freebsd-support: Change bash shebang to use /usr/bin/env --- Documentation/MANPAGE-render.bash | 2 +- benchmark-reverse.bash | 4 +++- benchmark.bash | 4 +++- build-without-openssl.bash | 4 +++- build.bash | 4 +++- contrib/gocryptfs-maybe.bash | 2 +- contrib/maxlen.bash | 2 +- internal/siv_aead/benchmark.bash | 2 +- internal/speed/benchmark.bash | 2 +- internal/stupidgcm/benchmark.bash | 2 +- package-release-tarballs.bash | 2 +- profiling/ls.bash | 4 +++- profiling/streaming-read.bash | 4 +++- profiling/streaming-write.bash | 4 +++- profiling/tar-extract.bash | 4 +++- profiling/write-trace.bash | 4 +++- test-without-openssl.bash | 4 +++- test.bash | 2 +- tests/canonical-benchmarks.bash | 3 ++- tests/dl-linux-tarball.bash | 4 +++- tests/fuse-unmount.bash | 5 ++++- tests/reverse/linux-tarball-test.bash | 2 +- tests/sshfs-benchmark.bash | 2 +- tests/stress_tests/extractloop.bash | 2 +- tests/stress_tests/fsstress-gocryptfs.bash | 2 +- tests/stress_tests/pingpong.bash | 2 +- 26 files changed, 52 insertions(+), 26 deletions(-) diff --git a/Documentation/MANPAGE-render.bash b/Documentation/MANPAGE-render.bash index c141c1e..2f19355 100755 --- a/Documentation/MANPAGE-render.bash +++ b/Documentation/MANPAGE-render.bash @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -eu cd "$(dirname "$0")" diff --git a/benchmark-reverse.bash b/benchmark-reverse.bash index fad6bfe..ca3bc9b 100755 --- a/benchmark-reverse.bash +++ b/benchmark-reverse.bash @@ -1,7 +1,9 @@ -#!/bin/bash -eu +#!/usr/bin/env bash # Benchmark gocryptfs' reverse mode +set -eu + cd "$(dirname "$0")" MYNAME=$(basename "$0") source tests/fuse-unmount.bash diff --git a/benchmark.bash b/benchmark.bash index fb99c65..f3d8a20 100755 --- a/benchmark.bash +++ b/benchmark.bash @@ -1,8 +1,10 @@ -#!/bin/bash -eu +#!/usr/bin/env bash # Run the set of "canonical" benchmarks that are shown on # https://nuetzlich.net/gocryptfs/comparison/ +set -eu + cd "$(dirname "$0")" MYNAME=$(basename "$0") source tests/fuse-unmount.bash diff --git a/build-without-openssl.bash b/build-without-openssl.bash index c09e7f3..388f823 100755 --- a/build-without-openssl.bash +++ b/build-without-openssl.bash @@ -1,4 +1,6 @@ -#!/bin/bash -eu +#!/usr/bin/env bash + +set -eu cd "$(dirname "$0")" diff --git a/build.bash b/build.bash index 5e95c3e..e78188e 100755 --- a/build.bash +++ b/build.bash @@ -1,4 +1,4 @@ -#!/bin/bash -eu +#!/usr/bin/env bash # # Compile gocryptfs and bake the git version string of itself and the go-fuse # library into the binary. @@ -10,6 +10,8 @@ # SOURCE_DATE_EPOCH=1544192417 ./build.bash # . +set -eu + cd "$(dirname "$0")" # $0 does not work because we may have been sourced diff --git a/contrib/gocryptfs-maybe.bash b/contrib/gocryptfs-maybe.bash index daf3e60..d83dd91 100755 --- a/contrib/gocryptfs-maybe.bash +++ b/contrib/gocryptfs-maybe.bash @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Conditionally try to mount a gocryptfs filesystem. If either # * CIPHERDIR/gocryptfs.conf does not exist OR diff --git a/contrib/maxlen.bash b/contrib/maxlen.bash index be5f7a6..4cf5802 100755 --- a/contrib/maxlen.bash +++ b/contrib/maxlen.bash @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Find out the maximum supported filename length and print it. # diff --git a/internal/siv_aead/benchmark.bash b/internal/siv_aead/benchmark.bash index 40b57b3..400c134 100755 --- a/internal/siv_aead/benchmark.bash +++ b/internal/siv_aead/benchmark.bash @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -eu diff --git a/internal/speed/benchmark.bash b/internal/speed/benchmark.bash index d2678a7..699ceb8 100755 --- a/internal/speed/benchmark.bash +++ b/internal/speed/benchmark.bash @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -eu diff --git a/internal/stupidgcm/benchmark.bash b/internal/stupidgcm/benchmark.bash index 8681495..8319659 100755 --- a/internal/stupidgcm/benchmark.bash +++ b/internal/stupidgcm/benchmark.bash @@ -1,3 +1,3 @@ -#!/bin/bash +#!/usr/bin/env bash exec ../speed/benchmark.bash diff --git a/package-release-tarballs.bash b/package-release-tarballs.bash index 881bce0..3581008 100755 --- a/package-release-tarballs.bash +++ b/package-release-tarballs.bash @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -eu diff --git a/profiling/ls.bash b/profiling/ls.bash index 35f5a39..334d8be 100755 --- a/profiling/ls.bash +++ b/profiling/ls.bash @@ -1,4 +1,6 @@ -#!/bin/bash -eu +#!/usr/bin/env bash + +set -eu cd "$(dirname "$0")" diff --git a/profiling/streaming-read.bash b/profiling/streaming-read.bash index 86ef942..138148c 100755 --- a/profiling/streaming-read.bash +++ b/profiling/streaming-read.bash @@ -1,4 +1,6 @@ -#!/bin/bash -eu +#!/usr/bin/env bash + +set -eu cd "$(dirname "$0")" diff --git a/profiling/streaming-write.bash b/profiling/streaming-write.bash index 6f3af56..3c29ee6 100755 --- a/profiling/streaming-write.bash +++ b/profiling/streaming-write.bash @@ -1,4 +1,6 @@ -#!/bin/bash -eu +#!/usr/bin/env bash + +set -eu cd "$(dirname "$0")" diff --git a/profiling/tar-extract.bash b/profiling/tar-extract.bash index f176368..e98100a 100755 --- a/profiling/tar-extract.bash +++ b/profiling/tar-extract.bash @@ -1,4 +1,6 @@ -#!/bin/bash -eu +#!/usr/bin/env bash + +set -eu cd "$(dirname "$0")" diff --git a/profiling/write-trace.bash b/profiling/write-trace.bash index 31af492..8b7cec9 100755 --- a/profiling/write-trace.bash +++ b/profiling/write-trace.bash @@ -1,8 +1,10 @@ -#!/bin/bash -eu +#!/usr/bin/env bash # # Write an execution trace of writing 100MB of data # to a new gocryptfs mount on /tmp +set -eu + cd "$(dirname "$0")" T=$(mktemp -d) diff --git a/test-without-openssl.bash b/test-without-openssl.bash index e596753..d2cd7e4 100755 --- a/test-without-openssl.bash +++ b/test-without-openssl.bash @@ -1,4 +1,6 @@ -#!/bin/bash -eu +#!/usr/bin/env bash + +set -eu cd "$(dirname "$0")" diff --git a/test.bash b/test.bash index d5da874..12e6b7f 100755 --- a/test.bash +++ b/test.bash @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # test.bash runs the gocryptfs test suite against $TMPDIR, # or, if unset, /var/tmp. diff --git a/tests/canonical-benchmarks.bash b/tests/canonical-benchmarks.bash index 4c1a357..963fd6a 100755 --- a/tests/canonical-benchmarks.bash +++ b/tests/canonical-benchmarks.bash @@ -1,4 +1,4 @@ -#!/bin/bash -eu +#!/usr/bin/env bash # # Run the set of "canonical" benchmarks that are shown on # https://nuetzlich.net/gocryptfs/comparison/ @@ -6,6 +6,7 @@ # # This is called by the top-level script "benchmark.bash". +set -eu MYNAME=$(basename "$0") diff --git a/tests/dl-linux-tarball.bash b/tests/dl-linux-tarball.bash index 03c0e7d..3c325db 100755 --- a/tests/dl-linux-tarball.bash +++ b/tests/dl-linux-tarball.bash @@ -1,8 +1,10 @@ -#!/bin/bash -eu +#!/usr/bin/env bash # # This script checks the size of /tmp/linux-3.0.tar.gz and downloads # a fresh copy if the size is incorrect or the file is missing. +set -eu + URL=https://cdn.kernel.org/pub/linux/kernel/v3.0/linux-3.0.tar.gz TGZ=/tmp/linux-3.0.tar.gz diff --git a/tests/fuse-unmount.bash b/tests/fuse-unmount.bash index b36f28c..02c6e4c 100755 --- a/tests/fuse-unmount.bash +++ b/tests/fuse-unmount.bash @@ -1,10 +1,13 @@ -#!/bin/bash -eu +#!/usr/bin/env bash # # Compatibility wrapper around "fusermount" on Linux and "umount" on # Mac OS X and friends. # # This script can be sourced or executed directly. # + +set -eu + fuse-unmount() { local MYNAME=$(basename "$BASH_SOURCE") if [[ $# -eq 0 ]] ; then diff --git a/tests/reverse/linux-tarball-test.bash b/tests/reverse/linux-tarball-test.bash index 4054c29..27afa23 100755 --- a/tests/reverse/linux-tarball-test.bash +++ b/tests/reverse/linux-tarball-test.bash @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -eu diff --git a/tests/sshfs-benchmark.bash b/tests/sshfs-benchmark.bash index 4695f8d..2421f20 100755 --- a/tests/sshfs-benchmark.bash +++ b/tests/sshfs-benchmark.bash @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -eu diff --git a/tests/stress_tests/extractloop.bash b/tests/stress_tests/extractloop.bash index 1f78a5e..714d2d7 100755 --- a/tests/stress_tests/extractloop.bash +++ b/tests/stress_tests/extractloop.bash @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Mount a gocryptfs filesystem somewhere on /tmp, then run two parallel # infinite loops inside that do the following: diff --git a/tests/stress_tests/fsstress-gocryptfs.bash b/tests/stress_tests/fsstress-gocryptfs.bash index e6c3281..7e3f160 100755 --- a/tests/stress_tests/fsstress-gocryptfs.bash +++ b/tests/stress_tests/fsstress-gocryptfs.bash @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Mount a gocryptfs filesystem in /var/tmp and run fsstress against it # in an infinite loop, only exiting on errors. diff --git a/tests/stress_tests/pingpong.bash b/tests/stress_tests/pingpong.bash index d0d21b3..4fd5ff2 100755 --- a/tests/stress_tests/pingpong.bash +++ b/tests/stress_tests/pingpong.bash @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Mounts two gocryptfs filesystems, "ping" and "pong" and moves the # linux-3.0 kernel tree back and forth between them, checking integrity -- cgit v1.2.3