aboutsummaryrefslogtreecommitdiffstats
path: root/packaging
diff options
context:
space:
mode:
authorMichael Schmitt <mschmitt@fastmail.net>2020-07-02 16:04:03 -0500
committerGerald Combs <gerald@wireshark.org>2020-07-15 16:52:47 +0000
commit34ff98c860382683abc7b91548a0361a0109b537 (patch)
treee74431e9f8dcc3e0bf362171b50d119d626566aa /packaging
parent7e4ff6f826f2345b87fa21ae5e3573e7b9569f00 (diff)
Assign access_bpf to GID less than 500
When installing ChmodBPF on macOS, assign the access_bpf group to the first free GID greater than 100, rather to the default which starts at 500. Using a GID less than 500 hides it in the System Preferences Users & Groups pane. Bug: 6402 Change-Id: I62ed63bc64cb2721880467ffd0dc290ea57c8461 Reviewed-on: https://code.wireshark.org/review/37676 Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'packaging')
-rwxr-xr-xpackaging/macosx/ChmodBPF/install-scripts/postinstall8
1 files changed, 6 insertions, 2 deletions
diff --git a/packaging/macosx/ChmodBPF/install-scripts/postinstall b/packaging/macosx/ChmodBPF/install-scripts/postinstall
index f84bbd3c9e..aca3c84dca 100755
--- a/packaging/macosx/ChmodBPF/install-scripts/postinstall
+++ b/packaging/macosx/ChmodBPF/install-scripts/postinstall
@@ -17,9 +17,13 @@ chmod -R a+rX,go-w "/Library/Application Support/Wireshark"
CHMOD_BPF_PLIST="/Library/LaunchDaemons/org.wireshark.ChmodBPF.plist"
BPF_GROUP="access_bpf"
BPF_GROUP_NAME="BPF device access ACL"
+min_gid=100
+
+if ! dscl . -read /Groups/"$BPF_GROUP" > /dev/null 2>&1; then
+ free_gid=$(dscl . -list /Groups PrimaryGroupID | sort -bnk2 | awk -v min_gid=$min_gid 'BEGIN{i=min_gid}{if($2==i)i++}END{print i}')
+ dseditgroup -q -o create -i $free_gid -r "$BPF_GROUP_NAME" "$BPF_GROUP"
+fi
-dscl . -read /Groups/"$BPF_GROUP" > /dev/null 2>&1 || \
- dseditgroup -q -o create "$BPF_GROUP"
dseditgroup -q -o edit -a "$USER" -t user "$BPF_GROUP"
cp "/Library/Application Support/Wireshark/ChmodBPF/org.wireshark.ChmodBPF.plist" \