웹상에서 system("/usr/local/bin/test") 명령을 사용하여 특정한 프로그램을 실행시키려 합니다.
test 프로그램 안에는 단순히 printf("Test Ok!"); 만 있습니다.
/var/www/cgi-bin/app.cgi 내에 system("~~"); 함수가 포함 되어 있고,
물론 cgi를 위한 태그가 있습니다.
[code:1]
app.cgi 프로그램 내부
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
int main(int argc, char *argv[])
{
int result;
// 웹을 이용한 프로그래밍일 경우 아래와 같이 꼭 써준다.