* 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
| 600 | * returns false if there were any. |
| 601 | */ |
| 602 | void |
| 603 | appendShellString(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 | |
| 614 | bool |
| 615 | appendShellStringNoError(PQExpBuffer buf, const char *str) |
nothing calls this directly
no test coverage detected