aboutsummaryrefslogtreecommitdiffstats
path: root/packaging
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2020-09-16 11:47:10 -0700
committerGerald Combs <gerald@wireshark.org>2020-09-18 16:34:24 +0000
commit59483604de93a222713506c96aacbc3832daca58 (patch)
tree083c9ce4d50fe1cd53fa9d11e54aa1a47fb65720 /packaging
parent888a8178f5c1b95a20c9964fe07069e79cf7cb49 (diff)
macOS: Switch ChmodBPF to zsh.
Switch the ChmodBPF script to /bin/zsh since it - Has known behavior, unlike /bin/sh, which execs whatever /private/var/select/sh points to. - Supports 'read -n 0' and other nice features. - Is unlikely to be deprecated, since it was made the default shell in Catalina[1]. - Exists in older macOS releases, unlike dash[2]. Closes #16826. [1]https://support.apple.com/en-us/HT208050 [2]https://scriptingosx.com/2020/06/about-bash-zsh-sh-and-dash-in-macos-catalina-and-beyond/
Diffstat (limited to 'packaging')
-rwxr-xr-xpackaging/macosx/ChmodBPF/root/Library/Application Support/Wireshark/ChmodBPF/ChmodBPF7
1 files changed, 4 insertions, 3 deletions
diff --git a/packaging/macosx/ChmodBPF/root/Library/Application Support/Wireshark/ChmodBPF/ChmodBPF b/packaging/macosx/ChmodBPF/root/Library/Application Support/Wireshark/ChmodBPF/ChmodBPF
index eaf160bf1b..1dc12e7a05 100755
--- a/packaging/macosx/ChmodBPF/root/Library/Application Support/Wireshark/ChmodBPF/ChmodBPF
+++ b/packaging/macosx/ChmodBPF/root/Library/Application Support/Wireshark/ChmodBPF/ChmodBPF
@@ -1,4 +1,5 @@
-#! /bin/sh
+#! /bin/zsh
+# shellcheck shell=bash
#
# Unfortunately, macOS's devfs is based on the old FreeBSD
@@ -27,12 +28,12 @@ if [ "$FORCE_CREATE_BPF_MAX" -gt "$SYSCTL_MAX" ] ; then
FORCE_CREATE_BPF_MAX=$SYSCTL_MAX
fi
-syslog -s -l notice "ChmodBPF: Forcing creation and setting permissions for /dev/bpf*"
+syslog -s -l notice "ChmodBPF: Forcing creation and setting permissions for /dev/bpf0-$(( FORCE_CREATE_BPF_MAX - 1))"
CUR_DEV=0
while [ "$CUR_DEV" -lt "$FORCE_CREATE_BPF_MAX" ] ; do
# Try to do the minimum necessary to trigger the next device.
- : < /dev/bpf$CUR_DEV > /dev/null 2>&1
+ read -r -n 0 < /dev/bpf$CUR_DEV > /dev/null 2>&1
CUR_DEV=$(( CUR_DEV + 1 ))
done