MCPcopy Create free account
hub / github.com/apache/cloudberry / appendShellString

Function appendShellString

src/fe_utils/string_utils.c:602–612  ·  view source on GitHub ↗

* 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. A future major release should * reject those char

Source from the content-addressed store, hash-verified

600 * returns false if there were any.
601 */
602void
603appendShellString(PQExpBuffer buf, const char *str)
604{
605 if (!appendShellStringNoError(buf, str))
606 {
607 fprintf(stderr,
608 _("shell command argument contains a newline or carriage return: \"%s\"\n"),
609 str);
610 exit(EXIT_FAILURE);
611 }
612}
613
614bool
615appendShellStringNoError(PQExpBuffer buf, const char *str)

Callers

nothing calls this directly

Calls 1

appendShellStringNoErrorFunction · 0.85

Tested by

no test coverage detected