From bfa94529e74113978e2400ce478de0d871105ea6 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Thu, 25 Mar 2021 11:31:55 +0100 Subject: [PATCH] osx: handle empty groups correctly when looking for a free UID This was already done this way with Homebrew. Fix #438. --- NEWS | 1 + osx/scripts/postinstall.in | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 1bc423bc..efcf9fa2 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ lldpd (1.0.9) + Do not use interface alias if we set it ourselves. + More memory leak fixes on duplicate TLVs in LLDP, CDP and EDP (related to CVE-2020-27827). + + On OSX, handle empty groups correctly when looking for a free UID/GID. * Changes: + Display port status with "show interfaces". + Do not display "age" and "via" when using "show interfaces". diff --git a/osx/scripts/postinstall.in b/osx/scripts/postinstall.in index afca49c8..9a21e745 100755 --- a/osx/scripts/postinstall.in +++ b/osx/scripts/postinstall.in @@ -10,7 +10,7 @@ $dscl . -read "/Users/${user}" &> /dev/null || { # We need to find a free UID/GID uid=200 while $($dscl . -list /Users uid | grep -q "\b${uid}$") || \ - $($dscl . -list /Users gid | grep -q "\b${uid}$"); do + $($dscl . -list /Groups gid | grep -q "\b${uid}$"); do uid=$((${uid} + 1)) done $dscl . -create /Groups/${group} -- 2.39.5