Debian Codegraph @

shquot/doc.go

raw
1 // Package shquot contains various functions for quoting sequences of
2 // command arguments for literal interpretation by different shells and other
3 // similar intermediaries that process incoming command lines.
4 //
5 // The functions all have the same signature, defined as type Q in this package,
6 // taking an array of arguments in the usual style passed to "execve" on a
7 // Unix/POSIX system.
8 //
9 // While calling "execve" directly is always preferable to avoid
10 // misinterpretation by intermediaries, sometimes such preprocessing cannot
11 // be avoided. For example, remote command execution protocols like SSH often
12 // expect a single string to be interpreted by a shell.
13 //
14 // Since each shell or intermediary has different details, it's important to
15 // select the correct quoting function for the target system or else the
16 // result may be misinterpreted.
17 //
18 // The goal of functions in this package is to cause a command line to be
19 // interpreted as if it were passed to the "execve" C function, bypassing any
20 // special behaviors of intermediaries such as wildcard expansion, alias
21 // expansion, pipelines, etc. If any shell behaviors are accessible through
22 // crafted input to the corresponding function then that's always considered
23 // to be a bug unless specifically noted in the documentation for that function.
24 package shquot