|
|
|
|
|
by mw42
4268 days ago
|
|
SQL injection is not avoided by escaping arguments, but by never mixing the command and user supplied arguments in the first place. The equivalent to your example would be execlp("mv", "mv", src, dest, NULL);
which does not rely on the shell to try to untangle your arguments from a single string.Edit: Fixed, thanks! |
|
People see:
as for the most part like: Where `escape()` is written by "smarter people" and makes sure that `id` isn't a string like this: (e.g. turning it into `0''; delete all from user;''`). I realize that this isn't what actually happens, but the general idea is that you are sanitizing your inputs.