180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
|
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
|
-
+
|
*/
static int safeCmdStrTest = 0;
/*
** Check the input string to ensure that it is safe to pass into system().
** A string is unsafe for system() on unix if it contains any of the following:
**
** * Any occurrance of '$' or '`' except after \
** * Any occurrance of '$' or '`' except single-quoted or after \
** * Any of the following characters, unquoted: ;|& or \n except
** these characters are allowed as the very last character in the
** string.
** * Unbalanced single or double quotes
**
** This routine is intended as a second line of defense against attack.
** It should never fail. Dangerous shell strings should be detected and
|