Added a C wrapper around the shell script to enable using setgid, because setgid doesn't work for shell scripts due to easy abuse.