Ignore environment variables in setuid or setgid programs.

Patch imported from Fedora.
Ensure strings comparisons are in-bounds.

Patch from Fedora.