From 1ea94055575fab4fc2c5ff037d31f04aa487a9b2 Mon Sep 17 00:00:00 2001 From: Viktor Liu Date: Wed, 5 Aug 2026 17:01:40 +0200 Subject: [PATCH] Build the elevation prompt only where the app that raises it is built --- client/internal/elevate/output.go | 1 - client/internal/elevate/run_unix.go | 2 +- client/internal/elevate/run_unix_test.go | 2 +- client/internal/elevate/run_unsupported.go | 10 +++++++--- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/client/internal/elevate/output.go b/client/internal/elevate/output.go index 2ff0bc143..6e1646bd3 100644 --- a/client/internal/elevate/output.go +++ b/client/internal/elevate/output.go @@ -6,7 +6,6 @@ import "strings" // said still reads as a sentence. const noOutput = "no output" -// firstLine trims captured output to something that reads in one line. func firstLine(s string) string { s = strings.TrimSpace(s) if s == "" { diff --git a/client/internal/elevate/run_unix.go b/client/internal/elevate/run_unix.go index 4a37670e2..b2de09a49 100644 --- a/client/internal/elevate/run_unix.go +++ b/client/internal/elevate/run_unix.go @@ -1,4 +1,4 @@ -//go:build linux || freebsd +//go:build linux package elevate diff --git a/client/internal/elevate/run_unix_test.go b/client/internal/elevate/run_unix_test.go index d9a9f900a..c868f9a74 100644 --- a/client/internal/elevate/run_unix_test.go +++ b/client/internal/elevate/run_unix_test.go @@ -1,4 +1,4 @@ -//go:build linux || freebsd +//go:build linux package elevate diff --git a/client/internal/elevate/run_unsupported.go b/client/internal/elevate/run_unsupported.go index 887525c4b..d1daf3184 100644 --- a/client/internal/elevate/run_unsupported.go +++ b/client/internal/elevate/run_unsupported.go @@ -1,11 +1,15 @@ -//go:build !windows && !darwin && !linux && !freebsd +//go:build !windows && !darwin && !linux package elevate import "context" -// run reports that this platform has no elevation prompt to drive. Mobile and -// WASM builds have no local user to ask in the first place. +// run reports that this platform has no elevation prompt to drive. +// +// The desktop app is the only caller and is not built for any of these: mobile +// and WASM have no local user to ask, and the FreeBSD client ships without a UI. +// pkexec would be the mechanism there, and run_unix.go is what to widen if that +// changes. func run(context.Context, string, []string) error { return ErrUnavailable }