summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ws2a/bugcomment.c18
-rw-r--r--ws2a/bugs/134
-rw-r--r--ws2a/gencaptcha.c8
3 files changed, 37 insertions, 23 deletions
diff --git a/ws2a/bugcomment.c b/ws2a/bugcomment.c
index fdee046..6bd70f2 100644
--- a/ws2a/bugcomment.c
+++ b/ws2a/bugcomment.c
@@ -79,12 +79,15 @@ int main(){
printf("%s%c%c\n","Content-Type:text/html;charset=iso-8859-1",13,10);
printf("<p>data:%s",data);
+ /*
char name[15];
char userid[20];
char comment[2048];
char captcha[25];
char bugid[5];
+ */
+ /*
char* iname = strtok(data,"&");
char* iuserid = strtok(NULL,"&");
char* icomment = strtok(NULL,"&");
@@ -96,6 +99,12 @@ int main(){
sscanf(icomment,"comment=%s",comment);
sscanf(icaptcha,"captcha=%s",captcha);
sscanf(ibugid,"bugid=%s",bugid);
+ */
+ char* name = "Apickx";
+ char* userid = "ThestID";
+ char* comment = "This+Is+My+Comment";
+ char* captcha = "teeny-tiny+currency";
+ char* bugid = "1";
printf("<p>name:%s<p>userid:%s<p>comment:%s<p>captcha:%s<p>bugid:%s",name,userid,comment,captcha,bugid);
@@ -103,22 +112,24 @@ int main(){
char captchapath[100];
char* captchadecoded = replaceHTML(captcha);
sprintf(captchapath,"../ws2a/captchas/%s.txt",captchadecoded);
- free(captchadecoded);
+
FILE* captchafile = fopen(captchapath,"r");
if(captchafile == NULL){
printf("Captcha incorrect");
return;
}
+ //Hash of "teeny-tiny currency" is 2053680550
unsigned long inputhash = hash(captchadecoded);
+ free(captchadecoded);
unsigned long filehash = 0;
fscanf(captchafile,"%lu",&filehash);
if(filehash != inputhash){
printf("Captcha incorrect");
- printf("input:%s correct:%s",inputhash,filehash);
+ printf("input:%lu correct:%lu",inputhash,filehash);
return;
}
printf("Captcha correct, deleteing...");
- /*
+
char command[100];
sprintf(command,"rm \"%s.txt\"",captchapath);
system(command);
@@ -139,7 +150,6 @@ int main(){
free(dname);
free(duid);
free(dcomment);
- */
/*
FILE* lastfilenum;
lastfilenum = fopen("../ws2a/bugs/lastbug","r");
diff --git a/ws2a/bugs/1 b/ws2a/bugs/1
index 5857a3a..932a7ab 100644
--- a/ws2a/bugs/1
+++ b/ws2a/bugs/1
@@ -1,15 +1,19 @@
-Submitter 8
-lasdfjla1231
-Date_submitted
-Short Description
-0:
-Long description
-2
-
-User person
-sdlfkj13221lkjl
-Comment
-
-Another User
-4234lkjsdf3234
-Their comment
+Submitter 8
+lasdfjla1231
+Date_submitted
+Short Description
+0:
+Long description
+2
+
+User person
+sdlfkj13221lkjl
+Comment
+
+Another User
+4234lkjsdf3234
+Their comment
+
+Apickx
+eD=$U&C]s&Ofyr6y^"{*cmd.Zò̺
+This Is My Comment
diff --git a/ws2a/gencaptcha.c b/ws2a/gencaptcha.c
index f40b165..cc57651 100644
--- a/ws2a/gencaptcha.c
+++ b/ws2a/gencaptcha.c
@@ -70,11 +70,11 @@ int main(){
int arcdis = (rand()%45)+45;
char command[1024];
unsigned long rhash = hash(randwords);
- sprintf(command,"convert -background white -fill black -pointsize 48 label:\"%s\" \"/home/git/wswebpage/ws2a/captchas/%lu.png\"",randwords,rhash);
+ sprintf(command,"convert -background white -fill black -pointsize 48 label:\"%s\" \"../ws2a/captchas/%lu.png\"",randwords,rhash);
system(command);
- sprintf(command,"convert \"/home/git/wswebpage/ws2a/captchas/%lu.png\" -distort Barrel \"0.0%d 0.0 0.0%d\" \"/home/git/wswebpage/ws2a/captchas/%lu.png\"",rhash,barraldis1,barraldis2,rhash);
+ sprintf(command,"convert \"../ws2a/captchas/%lu.png\" -distort Barrel \"0.0%d 0.0 0.0%d\" \"../ws2a/captchas/%lu.png\"",rhash,barraldis1,barraldis2,rhash);
system(command);
- sprintf(command,"convert \"/home/git/wswebpage/ws2a/captchas/%lu.png\" -virtual-pixel White -distort Arc %d \"/home/git/wswebpage/ws2a/captchas/%lu.png\"",rhash,arcdis,rhash);
+ sprintf(command,"convert \"\"../ws2a/captchas/%lu.png\" -virtual-pixel White -distort Arc %d \"../ws2a/captchas/%lu.png\"",rhash,arcdis,rhash);
system(command);
printf("%s%c%c\n","Content-Type:text/html;charset=iso-8859-1",13,10);
@@ -82,7 +82,7 @@ int main(){
FILE* tfile;
char filepath[100];
- sprintf(filepath,"/home/git/wswebpage/ws2a/captchas/%s.txt",randwords);
+ sprintf(filepath,"../ws2a/captchas/%s.txt",randwords);
tfile = fopen(filepath,"w");
fprintf(tfile,"%lu",rhash);
fclose(tfile);