From 00b747ad5d27e545a6f4d1afb8c23783cf6df2d8 Mon Sep 17 00:00:00 2001 From: Zoltan Papp Date: Wed, 14 Jan 2026 09:53:14 +0100 Subject: [PATCH] Handle fallback for invalid `loginuid` in `ui-post-install.sh`. (#5099) --- release_files/ui-post-install.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/release_files/ui-post-install.sh b/release_files/ui-post-install.sh index ff6c4ee9b..e2eb32cdc 100644 --- a/release_files/ui-post-install.sh +++ b/release_files/ui-post-install.sh @@ -8,6 +8,10 @@ pid="$(pgrep -x -f /usr/bin/netbird-ui || true)" if [ -n "${pid}" ] then uid="$(cat /proc/"${pid}"/loginuid)" + # loginuid can be 4294967295 (-1) if not set, fall back to process uid + if [ "${uid}" = "4294967295" ] || [ "${uid}" = "-1" ]; then + uid="$(stat -c '%u' /proc/"${pid}")" + fi username="$(id -nu "${uid}")" # Only re-run if it was already running pkill -x -f /usr/bin/netbird-ui >/dev/null 2>&1