1 // // //Download images and
5 // // //line 146 of cgi.h
10 // // ~~bicyclesonthemoon
20 #define WGET_PATH "/usr/bin/wget"
21 #define ENH_PATH "./bluenh"
22 #define RM_PATH "/bin/rm"
23 #define LOG_PATH "/eizm/log/bluenh/bluenh.log"
24 #define USERAGENT "Bluenhancement\x20(1190.bicyclesonthemoon.dnsd.info/bluenh/bluenh.htm)"
25 #define MSTD_PATH "/pro/bluenh/nh.png"
27 int main (int argc, char *argv[]);
28 void mustard(int mustard);
31 unsigned char buf[1024];
42 // unsigned char a,b,c,d,e,f;
45 int main (int argc, char *argv[])
52 sprintf(path,"%s",cgiGetFile(cgi,up[0])->tmpfile);
53 sprintf(url,"%s",cgiGetFile(cgi,up[0])->filename);
57 sprintf(url,"%s",(cgiGetValue(cgi,"inpix")!=NULL)?(cgiGetValue(cgi,"inpix")):"");
58 sprintf(path,"/var/tmp/%lu",(unsigned long)getpid());
60 //Why is there no spawnl() in linux?
64 t=execl(WGET_PATH,WGET_PATH,"-q","-t","2","-U",USERAGENT,"-O",path,url,(char *)0);
74 t=execl(ENH_PATH,ENH_PATH,path,path,cgiGetValue(cgi,"a")!=NULL?cgiGetValue(cgi,"a"):"0",cgiGetValue(cgi,"b")!=NULL?cgiGetValue(cgi,"b"):"127",cgiGetValue(cgi,"c")!=NULL?cgiGetValue(cgi,"c"):"255",cgiGetValue(cgi,"d")!=NULL?cgiGetValue(cgi,"d"):"0",cgiGetValue(cgi,"e")!=NULL?cgiGetValue(cgi,"e"):"127",cgiGetValue(cgi,"f")!=NULL?cgiGetValue(cgi,"f"):"255","q",(char *)0);
83 fstat(fileno(pix),&st);
87 printf("Content-Length: %lu\n",(unsigned long)(st.st_size));
88 printf("Content-type: image/png\n\n");
89 for(unsigned long i=0;i<p;++i)
91 fread(buf,1,1024,pix);
92 fwrite(buf,1,1024,stdout);
97 fwrite(buf,1,q,stdout);
101 mustard(0);//no mustard
104 void mustard(int mustard)
108 cgiRedirect(MSTD_PATH);
113 t=execl(RM_PATH,RM_PATH,"-f",path,(char *)0);
117 pix=fopen(LOG_PATH,"at");
120 fprintf(pix,"%x %s\n",mustard,url);