mirror of
https://github.com/netbirdio/netbird.git
synced 2026-09-17 20:29:07 +02:00
The install script downloaded both the macOS .pkg and the release tarballs into /tmp under fixed, predictable names, then passed those same paths to the privileged install steps (`installer -pkg`, `mv` into the install dir). /tmp is shared, so those fixed names can collide with entries created there beforehand, and the privileged steps consume whatever the path resolves to. Stage every download in a directory from `mktemp -d` instead: unpredictable name, mode 0700, owned by the caller, created atomically. Extraction now targets that directory (`tar -C`, `unzip -d`) rather than relying on `cd /tmp`, and an EXIT trap removes it, so a failed run no longer leaves the archive and the unpacked LICENSE/README behind in /tmp either.