/*
 *  fwlist.c
 *  change the path to the script in line 14
 *  compile with:               gcc fwlist.c -o fwlist
 *  then set the owner root:    sudo chown root:root fwlist
 *  then enable the suid-right: sudo chmod 4755 fwlist
*/

#include <unistd.h>
#include <errno.h>

int main( int argc, char ** argv, char ** envp )
{
    char script[]="/opt/fwlist.sh";
    if( setgid(getegid()) )     perror( "setgid" );
    if( setuid(geteuid()) )     perror( "setuid" );
    envp = 0;
    system( script, argv, envp );
    if ( errno )                perror( argv[0] );
    return errno;
}
