1
0
mirror of https://github.com/postgres/postgres.git synced 2026-10-23 13:29:09 +03:00

Restore comment at appendShellString().

Commit b380a56a3f removed a paragraph, but
two of the paragraph's three sentences remained relevant.

Backpatch-through: 19
This commit is contained in:
Noah Misch
2026-06-29 19:41:09 -07:00
parent 74e93d0f00
commit 7e5a19a16c

View File

@@ -568,6 +568,10 @@ appendByteaLiteral(PQExpBuffer buf, const unsigned char *str, size_t length,
* Append the given string to the shell command being built in the buffer,
* with shell-style quoting as needed to create exactly one argument.
*
* Forbid LF or CR characters, which have scant practical use beyond designing
* security breaches. The Windows command shell is unusable as a conduit for
* arguments containing LF or CR characters.
*
* appendShellString() simply prints an error and dies if LF or CR appears.
* appendShellStringNoError() omits those characters from the result, and
* returns false if there were any.