| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- package tools
- import "runtime"
- var safeCommands = []string{
- // Bash builtins and core utils
- "cal",
- "date",
- "df",
- "du",
- "echo",
- "env",
- "free",
- "groups",
- "hostname",
- "id",
- "kill",
- "killall",
- "ls",
- "nice",
- "nohup",
- "printenv",
- "ps",
- "pwd",
- "set",
- "time",
- "timeout",
- "top",
- "type",
- "uname",
- "unset",
- "uptime",
- "whatis",
- "whereis",
- "which",
- "whoami",
- // Git
- "git blame",
- "git branch",
- "git config --get",
- "git config --list",
- "git describe",
- "git diff",
- "git grep",
- "git log",
- "git ls-files",
- "git ls-remote",
- "git remote",
- "git rev-parse",
- "git shortlog",
- "git show",
- "git status",
- "git tag",
- }
- func init() {
- if runtime.GOOS == "windows" {
- safeCommands = append(
- safeCommands,
- // Windows-specific commands
- "ipconfig",
- "nslookup",
- "ping",
- "systeminfo",
- "tasklist",
- "where",
- )
- }
- }
|