]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Restore comment at appendShellString().
authorNoah Misch <noah@leadboat.com>
Tue, 30 Jun 2026 02:41:09 +0000 (19:41 -0700)
committerNoah Misch <noah@leadboat.com>
Tue, 30 Jun 2026 02:41:09 +0000 (19:41 -0700)
Commit b380a56a3f9556588a89013b765d67947d54f7d0 removed a paragraph, but
two of the paragraph's three sentences remained relevant.

Backpatch-through: 19

src/fe_utils/string_utils.c

index 38fffbd036bf79cfd80b70c56aaa0c0166730477..7a762251f32bdab39293bdbbb3808cccc795f751 100644 (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.