Shell scripts with SUID

Hello,
I have a question, when i set suid bit to an executable file everything looks normal (the program will work with owner of the files privilage). When I set suid bit on a shell script it has the normal privilage (not owner of the file privilage) when i run the script. Can anyone explain me why shell scripts act different from executable files with suid set on? Below are the code of shell script and program written in C.

Shell scripts
Code:
cat /etc/master.passwd

Program written in C
Code:
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[]) {
int status;

if( (status = system(argv[1])) < 0)
        exit(0);

return 0;
}

I now that they are not secure i just want to now the different betwen them when suid is set.

Best regards
 
Back
Top