INNER CODE UNIT · Go

shellescape

iximiuz/cdebug · cmd/exec/exec.go:377

func shellescape(args []string) (escaped []string) {
	for _, a := range args {
		if strings.ContainsAny(a, " \t\n\r") {
			a = `"` + a + `"`
		}
		escaped = append(escaped, a)
	}
	return
}

func isRootUser(user string) bool {
	return len(user) == 0 || user == "root" || user == "0" || user == "0:0"
}

func wrapExitError(err error) error {
	if err == nil {
		return nil
	}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…