- // //Download images and add
- // // Newpixbots to them!
+// // //Download images and add
+ // // Newpixbots to them! (or Megans)
// //
// // Requires cgilib
// // //line 146 of cgi.h
#include <cgi.h>
#include <stdio.h>
#include <stdlib.h>
-//#include <strings.h>
#include <unistd.h>
+#include <string.h>
#include <sys/wait.h>
#include <sys/stat.h>
-#define WGET_PATH "/usr/bin/wget"
-#define NPB_PATH "./npb"
-#define RM_PATH "/bin/rm"
-#define LOG_PATH "/var/log/npb/npb.log"
-#define USERAGENT "NewpixbOTTification\x20(1190.bicyclesonthemoon.dnsd.info/npb/npb.htm)"
+#define WGET_PATH "/usr/bin/wget"
+#define NPB_PATH "./npb"
+#define MEG_PATH "./403"
+#define RM_PATH "/bin/rm"
+#define LOG_PATH "/var/log/npb/npb.log"
+#define LOG_PATH2 "/var/log/npb/403.log"
+#define USERAGENT "NewpixbOTTification\x20(1190.bicyclesonthemoon.dnsd.info/npb/npb.htm)"
+#define USERAGENT2 "403fication\x20(1190.bicyclesonthemoon.dnsd.info/npb/403.htm)"
+#define MSTD_PATH "/pro/npb/mpb.png"
+#define MSTD_PATH2 "/pro/npb/503.png"
int main (int argc, char *argv[]);
void mustard(int mustard);
unsigned long p;
unsigned short q;
char **up;
+bool meg=false;
int main (int argc, char *argv[])
{
cgi=cgiInit();
+ sprintf(path,"%s",(getenv("PATH_INFO")!=NULL)?(getenv("PATH_INFO")):"");
+ if(strcmp(path,"/403")==0)
+ {
+ meg=true;
+ //mustard(0);
+ }
+
up=cgiGetFiles(cgi);
if (up)
{
sub=fork();
if(sub==0)
{
- t=execl(WGET_PATH,WGET_PATH,"-q","-t","2","-U",USERAGENT,"-O",path,url,(char *)0);
+ t=execl(WGET_PATH,WGET_PATH,"-q","-t","2","-U",meg?USERAGENT2:USERAGENT,"-O",path,url,(char *)0);
exit(t);
}
waitpid(sub,&t,0);
sub=fork();
if(sub==0)
{
- t=execl(NPB_PATH,NPB_PATH,path,path,"q",(char *)0);
+ t=execl(meg?MEG_PATH:NPB_PATH,meg?MEG_PATH:NPB_PATH,path,path,"q",(char *)0);
exit(t);
}
waitpid(sub,&t,0);
{
if(mustard)
{
- cgiRedirect("/pro/npb/mpb.png");
+ cgiRedirect(meg?MSTD_PATH2:MSTD_PATH);
}
sub=fork();
if(sub==0)
exit(t);
}
waitpid(sub,&t,0);
- pix=fopen(LOG_PATH,"at");
+ pix=fopen(meg?LOG_PATH2:LOG_PATH,"at");
if(pix!=NULL)
{
fprintf(pix,"%x %s\n",mustard,url);