From the manual page of "system", on a Debian GNU/Linux system:


Do not use system() from a program with set-user-ID or set-group-ID privileges, because strange values for some environment...