Name

ap_escape_shell_cmd — escape dangerous characters in a shell command

Synopsis

char *ap_escape_shell_cmd(pool *p, const char *s)

Prefixes dangerous characters in s with a backslash, returning the new version. The current set of dangerous characters is as follows:

&;`'\"|*?~<>^()[]{}$\\\n

Under OS/2, & is converted to a space.[2]

[2] Don’t think that using this function makes shell scripts safe: it doesn’t. See Chapter 11.

Get Apache: The Definitive Guide, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.