mirror of
https://github.com/netbirdio/netbird.git
synced 2026-08-26 17:41:30 +02:00
24 lines
657 B
Go
24 lines
657 B
Go
//go:build windows
|
|
|
|
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"golang.org/x/sys/windows"
|
|
)
|
|
|
|
// isProcessPrivileged reports whether the current process token is elevated
|
|
// (running as administrator / LocalSystem).
|
|
func isProcessPrivileged() bool {
|
|
return windows.GetCurrentProcessToken().IsElevated()
|
|
}
|
|
|
|
// runElevated should re-run exe with args elevated via a UAC prompt
|
|
// (ShellExecuteEx with the "runas" verb).
|
|
//
|
|
// TODO(ssh-elevation): implement ShellExecuteEx("runas") + wait for the child.
|
|
func runElevated(_ string, _ []string) error {
|
|
return fmt.Errorf("automatic privilege elevation is not yet implemented on Windows, re-run netbird as administrator")
|
|
}
|