safe.go 857 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. package tools
  2. import "runtime"
  3. var safeCommands = []string{
  4. // Bash builtins and core utils
  5. "cal",
  6. "date",
  7. "df",
  8. "du",
  9. "echo",
  10. "env",
  11. "free",
  12. "groups",
  13. "hostname",
  14. "id",
  15. "kill",
  16. "killall",
  17. "ls",
  18. "nice",
  19. "nohup",
  20. "printenv",
  21. "ps",
  22. "pwd",
  23. "set",
  24. "time",
  25. "timeout",
  26. "top",
  27. "type",
  28. "uname",
  29. "unset",
  30. "uptime",
  31. "whatis",
  32. "whereis",
  33. "which",
  34. "whoami",
  35. // Git
  36. "git blame",
  37. "git branch",
  38. "git config --get",
  39. "git config --list",
  40. "git describe",
  41. "git diff",
  42. "git grep",
  43. "git log",
  44. "git ls-files",
  45. "git ls-remote",
  46. "git remote",
  47. "git rev-parse",
  48. "git shortlog",
  49. "git show",
  50. "git status",
  51. "git tag",
  52. }
  53. func init() {
  54. if runtime.GOOS == "windows" {
  55. safeCommands = append(
  56. safeCommands,
  57. // Windows-specific commands
  58. "ipconfig",
  59. "nslookup",
  60. "ping",
  61. "systeminfo",
  62. "tasklist",
  63. "where",
  64. )
  65. }
  66. }