Documentation ¶
Overview ¶
Package shsprintf is a drop-in-replacement for using sprintf to produce shell scripts, that adds automatic detection for command / argument injection.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidShTemplate error = errors.New("Invalid Shell Template")
ErrInvalidShTemplate indicates the requested template is not a valid script
var ErrShInjection error = errors.New("Shell Injection Detected")
ErrShInjection indicates the inputs resulted in shell injection.
Functions ¶
func EscapeDefaultContext ¶
EscapeDefaultContext escapes special characters in a context where there is no existing quoting, such as --arg=%s
func MustSprintf ¶
MustSprintf is a wrapper to Sprintf that panics upon error.
func Sprintf ¶
Sprintf is a fmt.Sprintf replacement specific for generating bash scripts, with protection against any string substitution from escaping its context, or from injecting new flag arguments.
func SprintfLang ¶
SprintfLang is a fmt.Sprintf replacement specific for generating shell scripts, with protection against any string substitution from escaping its context, or from injecting new flag arguments.
Types ¶
This section is empty.