Files
netbird/client/ui/services/debug_reveal_other.go
T
Zoltán Papp 1f69cd189e ui: elevate Windows debug-bundle reveal to bypass SystemTemp ACL
The daemon runs as SYSTEM and writes the bundle into C:\Windows\SystemTemp,
whose ACL denies the logged-in user, so a plain 'explorer /select' could not
open it. The Windows reveal now elevates via ShellExecuteW with the runas verb,
falling back to an unelevated reveal of the parent dir on decline.
2026-06-16 15:34:09 +02:00

21 lines
402 B
Go

//go:build !android && !ios && !freebsd && !js && !windows
package services
import (
"os/exec"
"path/filepath"
"runtime"
)
// revealFile opens the OS file manager focused on path.
func revealFile(path string) error {
var cmd *exec.Cmd
if runtime.GOOS == "darwin" {
cmd = exec.Command("open", "-R", path)
} else {
cmd = exec.Command("xdg-open", filepath.Dir(path))
}
return cmd.Start()
}