diff options
Diffstat (limited to 'www')
-rw-r--r-- | www/cgichk/files/patch-Makefile | 11 | ||||
-rw-r--r-- | www/cgichk/files/patch-cgichk.c | 56 | ||||
-rw-r--r-- | www/cgichk/files/patch-cgichk.h | 32 | ||||
-rw-r--r-- | www/cgichk/files/patch-config.c | 19 | ||||
-rw-r--r-- | www/cgichk/files/patch-misc.c | 22 | ||||
-rw-r--r-- | www/cgichk/files/patch-net.c | 27 |
6 files changed, 155 insertions, 12 deletions
diff --git a/www/cgichk/files/patch-Makefile b/www/cgichk/files/patch-Makefile new file mode 100644 index 000000000000..b3c8ec69a982 --- /dev/null +++ b/www/cgichk/files/patch-Makefile @@ -0,0 +1,11 @@ +--- Makefile.orig 2011-09-06 11:10:37.000000000 +0800 ++++ Makefile 2011-09-06 11:10:42.000000000 +0800 +@@ -1,7 +1,7 @@ + # Where cgichk goes when user decides to install + INSTALLDIR=/usr/local/bin + +-CC = gcc ++CC ?= gcc + OPTIONS = $(WINCRAP) + CFLAGS = -O2 -s $(OPTIONS) + OUTPUT = cgichk diff --git a/www/cgichk/files/patch-cgichk.c b/www/cgichk/files/patch-cgichk.c new file mode 100644 index 000000000000..3061c03f19db --- /dev/null +++ b/www/cgichk/files/patch-cgichk.c @@ -0,0 +1,56 @@ +--- cgichk.c.orig 2001-04-06 16:36:25.000000000 +0800 ++++ cgichk.c 2011-09-06 11:29:49.000000000 +0800 +@@ -58,7 +58,7 @@ void check_dir_only() + CPRINT(" \r"); + CPRINT(" Looking for /%s\r", r->v[count]); + +- if (result = http_has(temp,0)) ++ if ((result = http_has(temp,0))) + { + CPRINT(" \r"); + PRINT(" Found /%s (%d) \n", r->v[count], result); +@@ -77,7 +77,7 @@ void check_hole(char *hole) + CPRINT(" \r"); + CPRINT(" Looking for %s\r", hole); + +- if (result = http_has(hole,0)) ++ if ((result = http_has(hole,0))) + { + CPRINT(" \r"); + PRINT(" Found %s (%d)\n",hole, result); +@@ -131,7 +131,7 @@ void check_interest() + + CPRINT(" Looking for /%s \r", r->v[y]); + +- if (result = http_has(temp,0)) // See if the directory exists, so no wasted time ++ if ((result = http_has(temp,0))) // See if the directory exists, so no wasted time + { + PRINT(" Found %s (%d) \n", temp, result); + BEEP(); +@@ -144,7 +144,7 @@ void check_interest() + CPRINT(" \r"); + CPRINT(" Looking for /%s \r", temp); + +- if (result = http_has(temp,0)) ++ if ((result = http_has(temp,0))) + { + PRINT(" ---> /%s (%d)\n", temp, result); + BEEP(); +@@ -289,7 +289,7 @@ void get_commandline(int argc, char *arg + + parms.URL = (char*) strdup(argv[optind]); + +- breakup_url(parms.URL, domain, 1024, &parms.port, 80, dir, 1024); ++ breakup_url(parms.URL, domain, 1024, (int *)&parms.port, 80, dir, 1024); + } + /*----------------------------------------------------------------*/ + void mainloop() +@@ -343,7 +343,7 @@ int main(int argc, char *argv[]) + { + char *env = NULL; + +- if (env = getenv(PROXY_ENV)) ++ if ((env = getenv(PROXY_ENV))) + { + proxy.host = (char *) malloc(strlen(env)); + breakup_url(env, proxy.host, strlen(env), &proxy.port, 8000, NULL, 0); diff --git a/www/cgichk/files/patch-cgichk.h b/www/cgichk/files/patch-cgichk.h index 413b64e5d80d..4bf9b8e455d7 100644 --- a/www/cgichk/files/patch-cgichk.h +++ b/www/cgichk/files/patch-cgichk.h @@ -1,6 +1,6 @@ ---- cgichk.h.orig 2007-11-08 12:58:24.000000000 +0000 -+++ cgichk.h 2007-11-08 12:58:46.000000000 +0000 -@@ -19,6 +19,8 @@ +--- cgichk.h.orig 2001-04-06 16:36:25.000000000 +0800 ++++ cgichk.h 2011-09-06 11:30:51.000000000 +0800 +@@ -19,13 +19,17 @@ #include <stdio.h> #include <stdlib.h> @@ -8,4 +8,30 @@ +#include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> ++#include <arpa/inet.h> #include <netdb.h> + #include <stdarg.h> + #include <getopt.h> + #include <time.h> + #include <unistd.h> ++#include <ctype.h> + + #ifdef DEBUG + #define MEMWATCH +@@ -125,3 +129,16 @@ extern struct in_addr addr; + extern struct sockaddr_in _sin; + extern struct hostent *he; + ++void waitafew(unsigned int del); ++void PRINT(char *arg, ...); ++void CPRINT(char *arg, ...); ++void close_config(result_t *r); ++void read_config(result_t *r, char *section); ++int setup_socket(char *host, int port); ++void PerformWhois(char *domain); ++result_t *open_config(char *fn); ++void read_head(); ++int http_has(char *file, int result); ++void free_strings(result_t *r); ++void breakup_url(char *_url, char *_host, int hl, int *_port, int defport, char *_path, int pl); ++char *cgichk_strnstr(const char *HAYSTACK, const char *NEEDLE); diff --git a/www/cgichk/files/patch-config.c b/www/cgichk/files/patch-config.c new file mode 100644 index 000000000000..718d8cbc04c4 --- /dev/null +++ b/www/cgichk/files/patch-config.c @@ -0,0 +1,19 @@ +--- config.c.orig 2011-09-06 11:18:17.000000000 +0800 ++++ config.c 2011-09-06 11:18:33.000000000 +0800 +@@ -30,14 +30,14 @@ result_t *open_config(char *fn) + } + + // ...try defaults, current dir... +- if (r->F = fopen("./cgichk.cfg", "rb")) ++ if ((r->F = fopen("./cgichk.cfg", "rb"))) + { + resultfile = (char *) strdup("./cgichk.cfg"); + return r; + } + + // ...and then config dir +- if (r->F = fopen(CONFIG_PATH, "rb")) ++ if ((r->F = fopen(CONFIG_PATH, "rb"))) + { + resultfile = (char *) strdup(CONFIG_PATH); + return r; diff --git a/www/cgichk/files/patch-misc.c b/www/cgichk/files/patch-misc.c index 017434a31470..57e5b17daa8f 100644 --- a/www/cgichk/files/patch-misc.c +++ b/www/cgichk/files/patch-misc.c @@ -1,15 +1,27 @@ ---- misc.c.orig 2007-11-08 13:41:34.000000000 +0000 -+++ misc.c 2007-11-08 13:43:22.000000000 +0000 -@@ -92,7 +92,7 @@ +--- misc.c.orig 2001-04-06 16:36:25.000000000 +0800 ++++ misc.c 2011-09-06 11:17:27.000000000 +0800 +@@ -83,16 +83,16 @@ void breakup_url( char *_url, + + *_port = defport; + +- if ( t = (char *)strstr(u, "://") ) // skip past http bit ++ if ((t = (char *)strstr(u, "://"))) // skip past http bit + u = t + 3; + + // parse hostname and port + +- if (t = (char *)index(u, ':')) // does host have a port #? ++ if ((t = (char *)index(u, ':'))) // does host have a port #? hasport = 1; - if (t = (char *)index(u, '/')) // does host have path? +- if (t = (char *)index(u, '/')) // does host have path? - (char *)haspath = 1; ++ if ((t = (char *)index(u, '/'))) // does host have path? + haspath = 1; if (hasport) t = (char *)index(u, ':'); -@@ -209,7 +209,7 @@ +@@ -209,7 +209,7 @@ char *lowerstr(char *str) return str; } /*----------------------------------------------------------------*/ diff --git a/www/cgichk/files/patch-net.c b/www/cgichk/files/patch-net.c index e95660ad092f..396a82092287 100644 --- a/www/cgichk/files/patch-net.c +++ b/www/cgichk/files/patch-net.c @@ -1,6 +1,25 @@ ---- net.c.orig 2007-11-08 13:24:24.000000000 +0000 -+++ net.c 2007-11-08 13:27:30.000000000 +0000 -@@ -150,10 +150,10 @@ +--- net.c.orig 2001-04-06 16:36:25.000000000 +0800 ++++ net.c 2011-09-06 11:35:01.000000000 +0800 +@@ -9,6 +9,7 @@ proxy_t proxy = {NULL, 8000}; + /*----------------------------------------------------------------*/ + int setup_socket(char *host, int port) + { ++ struct in_addr addr; + unsigned long start; + unsigned long end; + unsigned long counter; +@@ -24,8 +25,8 @@ int setup_socket(char *host, int port) + } + + //start = inet_addr(host); +- inet_aton(host, &start); // rather than inet_addr, etc. +- counter = ntohl(start); ++ inet_aton(host, &addr); // rather than inet_addr, etc. ++ counter = ntohl(addr.s_addr); + + sock = socket(AF_INET, SOCK_STREAM, 0); + bcopy(he->h_addr, (char *) &_sin.sin_addr, he->h_length); +@@ -150,10 +151,10 @@ int http_has(char *file, int result) { if (parms.no_false_200_search == FALSE) { @@ -15,7 +34,7 @@ { err = HTTP_NOEXIST; } -@@ -161,7 +161,7 @@ +@@ -161,7 +162,7 @@ int http_has(char *file, int result) // If user spcified an additional string to search for, check for that too. if (parms.alt_fake_404_string) { |