This commit is contained in:
Viktor Liu
2025-07-02 21:04:58 +02:00
parent 96084e3a02
commit 0d5408baec
8 changed files with 234 additions and 67 deletions

View File

@@ -378,14 +378,6 @@ func isWindowsPrivilegedSID(sid string) bool {
return false
}
// buildShellArgs builds shell arguments for executing commands
func buildShellArgs(shell, command string) []string {
if command != "" {
return []string{shell, "-Command", command}
}
return []string{shell}
}
// isCurrentProcessPrivileged checks if the current process is running with elevated privileges.
// On Unix systems, this means running as root (UID 0).
// On Windows, this means running as Administrator or SYSTEM.