]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
osx: handle empty groups correctly when looking for a free UID
authorVincent Bernat <vincent@bernat.ch>
Thu, 25 Mar 2021 10:31:55 +0000 (11:31 +0100)
committerVincent Bernat <vincent@bernat.ch>
Thu, 25 Mar 2021 10:32:59 +0000 (11:32 +0100)
This was already done this way with Homebrew. Fix #438.

NEWS
osx/scripts/postinstall.in

diff --git a/NEWS b/NEWS
index 1bc423bc7f436aeff3f4633c14e8a5440fb4bde4..efcf9fa260152f00fb75faee035eaac1085bb7fe 100644 (file)
--- 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".
index afca49c80550c5cb9f414b388b7ec786fe1614f7..9a21e7455a439665131109e3d98226846b007b54 100755 (executable)
@@ -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}