diff options
Diffstat (limited to 'www/pserv')
-rw-r--r-- | www/pserv/Makefile | 4 | ||||
-rw-r--r-- | www/pserv/distinfo | 2 | ||||
-rw-r--r-- | www/pserv/files/patch-Makefile | 6 | ||||
-rw-r--r-- | www/pserv/files/patch-handlers.c | 100 | ||||
-rw-r--r-- | www/pserv/files/patch-main.h | 21 | ||||
-rw-r--r-- | www/pserv/files/patch-pserv.conf | 16 |
6 files changed, 50 insertions, 99 deletions
diff --git a/www/pserv/Makefile b/www/pserv/Makefile index 728ffd2120db..4c3dfb0c9682 100644 --- a/www/pserv/Makefile +++ b/www/pserv/Makefile @@ -6,11 +6,11 @@ # PORTNAME= pserv -PORTVERSION= 3.0.b1 +PORTVERSION= 3.0.b2 CATEGORIES= www MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= ${PORTNAME} -DISTNAME= ${PORTNAME}-22-Sep-03 +DISTNAME= ${PORTNAME}-20-Oct-03 EXTRACT_SUFX= .tar.Z MAINTAINER= sysadmin@alexdupre.com diff --git a/www/pserv/distinfo b/www/pserv/distinfo index 6eda3d6fbb2c..909c519f354c 100644 --- a/www/pserv/distinfo +++ b/www/pserv/distinfo @@ -1 +1 @@ -MD5 (pserv-22-Sep-03.tar.Z) = 4895631b730836c9202d5ac28b05f0fa +MD5 (pserv-20-Oct-03.tar.Z) = 1b38238b8de0704b03ae245271f4899e diff --git a/www/pserv/files/patch-Makefile b/www/pserv/files/patch-Makefile index 270d791c64a1..2a22cecc3b5c 100644 --- a/www/pserv/files/patch-Makefile +++ b/www/pserv/files/patch-Makefile @@ -1,12 +1,12 @@ ---- Makefile.orig Mon Sep 8 20:05:54 2003 -+++ Makefile Thu Oct 16 14:24:50 2003 +--- Makefile.orig Tue Oct 21 00:05:55 2003 ++++ Makefile Tue Oct 21 00:07:34 2003 @@ -1,11 +1,11 @@ #Change the following to your needs -CC = gcc +CC ?= gcc #insert here flags, eg. optimizations -CFLAGS = -Wall -O3 --LIBS = -lnsl -lsocket +-LIBS = SRCS = main.c handlers.c mime.c log.c OBJS = main.o handlers.o mime.o log.o PROGRAM = pserv diff --git a/www/pserv/files/patch-handlers.c b/www/pserv/files/patch-handlers.c index 2a943605a18d..9339502572f6 100644 --- a/www/pserv/files/patch-handlers.c +++ b/www/pserv/files/patch-handlers.c @@ -1,5 +1,5 @@ ---- handlers.c.orig Thu Sep 18 15:26:48 2003 -+++ handlers.c Thu Oct 16 14:16:05 2003 +--- handlers.c.orig Mon Oct 20 10:27:32 2003 ++++ handlers.c Tue Oct 21 00:13:59 2003 @@ -24,6 +24,7 @@ #endif @@ -8,10 +8,10 @@ extern int port; /* server port */ extern char defaultFileName[MAX_PATH_LEN+1]; /* default name for index, default or similar file */ -@@ -262,12 +263,33 @@ - newArgv[i] = NULL; /* we correctly terminate argv */ +@@ -263,6 +264,14 @@ i = 0; + /* beware of not overfilling this array, check MAX_ENVP_LEN */ + if (req.contentLength != -1) + { + sprintf(newEnvp[i++], "CONTENT_LENGTH=%ld", req.contentLength); @@ -23,33 +23,19 @@ strcpy(newEnvp[i], "SERVER_SOFTWARE="); strcat(newEnvp[i], SERVER_SOFTWARE_STR); strcat(newEnvp[i], "/"); - strcat(newEnvp[i++], SERVER_VERSION_STR); -+ strcpy(newEnvp[i], "SERVER_PROTOCOL="); -+ strcat(newEnvp[i++], req.protocolVersion); - strcpy(newEnvp[i], "REQUEST_METHOD="); - strcat(newEnvp[i++], req.method); -+ strcpy(newEnvp[i], "REMOTE_ADDR="); -+ strcat(newEnvp[i++], req.address); -+ strcpy(newEnvp[i], "HTTP_USER_AGENT="); -+ strcat(newEnvp[i++], req.userAgent); +@@ -285,6 +294,11 @@ + strcat(newEnvp[i++], req.userAgent); + strcpy(newEnvp[i], "SCRIPT_FILENAME="); + strcat(newEnvp[i++], completedPath); + if (req.cookie[0] != '\0') + { + strcpy(newEnvp[i], "HTTP_COOKIE="); + strcat(newEnvp[i++], req.cookie); + } -+ strcpy(newEnvp[i], "SCRIPT_FILENAME="); -+ strcat(newEnvp[i++], completedPath); - strcpy(newEnvp[i], "SCRIPT_NAME="); - strcat(newEnvp[i++], req.documentAddress); - strcpy(newEnvp[i], "GATEWAY_INTERFACE="); -@@ -302,13 +324,256 @@ - execve(completedPath, newArgv, newEnvp); - /* we reach this line only if an execution error occoured */ - /* logging will happen in the father */ -- printf("\n<HTML><HEAD><TITLE>CGI Error</TITLE></HEAD><BODY><H1>Cgi Exec error</H1></BODY></HTML>\n"); -+ printf("\n<HTML><HEAD><TITLE>CGI Error</TITLE></HEAD><BODY><H1>CGI Exec error</H1></BODY></HTML>\n"); - exit(-1); - } + newEnvp[i] = NULL; + + /* we change the current working directory to the scripts one */ +@@ -317,7 +331,244 @@ return 0; } @@ -228,41 +214,35 @@ + newArgv[i] = NULL; /* we correctly terminate argv */ + + i = 0; -+ if (req.contentLength != -1) -+ { -+ sprintf(newEnvp[i++], "CONTENT_LENGTH=%ld", req.contentLength); -+ strcpy(newEnvp[i], "CONTENT_TYPE="); -+ strcat(newEnvp[i++], req.contentType); -+ } + strcpy(newEnvp[i], "SERVER_NAME="); + strcat(newEnvp[i++], DEFAULT_SERVER_NAME); + strcpy(newEnvp[i], "SERVER_SOFTWARE="); + strcat(newEnvp[i], SERVER_SOFTWARE_STR); + strcat(newEnvp[i], "/"); + strcat(newEnvp[i++], SERVER_VERSION_STR); -+ strcpy(newEnvp[i], "SERVER_PROTOCOL="); -+ strcat(newEnvp[i++], req.protocolVersion); + strcpy(newEnvp[i], "REQUEST_METHOD="); + strcat(newEnvp[i++], req.method); ++ strcpy(newEnvp[i], "SCRIPT_NAME="); ++ strcat(newEnvp[i++], req.documentAddress); ++ strcpy(newEnvp[i], "GATEWAY_INTERFACE="); ++ strcat(newEnvp[i++], CGI_VERSION); ++ sprintf(newEnvp[i++], "SERVER_PORT=%d", port); ++ strcpy(newEnvp[i++], envPath); ++ strcpy(newEnvp[i], "QUERY_STRING="); ++ strcat(newEnvp[i++], req.queryString); ++ strcpy(newEnvp[i], "SERVER_PROTOCOL="); ++ strcat(newEnvp[i++], req.protocolVersion); + strcpy(newEnvp[i], "REMOTE_ADDR="); + strcat(newEnvp[i++], req.address); + strcpy(newEnvp[i], "HTTP_USER_AGENT="); + strcat(newEnvp[i++], req.userAgent); ++ strcpy(newEnvp[i], "SCRIPT_FILENAME="); ++ strcat(newEnvp[i++], completedPath); + if (req.cookie[0] != '\0') + { + strcpy(newEnvp[i], "HTTP_COOKIE="); + strcat(newEnvp[i++], req.cookie); + } -+ strcpy(newEnvp[i], "SCRIPT_FILENAME="); -+ strcat(newEnvp[i++], completedPath); -+ strcpy(newEnvp[i], "SCRIPT_NAME="); -+ strcat(newEnvp[i++], req.documentAddress); -+ strcpy(newEnvp[i], "GATEWAY_INTERFACE="); -+ strcat(newEnvp[i++], CGI_VERSION); -+ sprintf(newEnvp[i++], "SERVER_PORT=%d", port); -+ strcpy(newEnvp[i++], envPath); -+ strcpy(newEnvp[i], "QUERY_STRING="); -+ strcat(newEnvp[i++], req.queryString); + newEnvp[i] = NULL; + + /* we change the current working directory to the scripts one */ @@ -301,7 +281,7 @@ int sock; char filePath[]; char mimeType[]; -@@ -351,11 +616,11 @@ +@@ -360,11 +611,11 @@ return -1; } stat(filePath, &fileStats); @@ -315,7 +295,7 @@ fatal = NO; retry = NO; while(!feof(inFile) && !fatal) -@@ -399,11 +664,11 @@ +@@ -408,11 +659,11 @@ if (howMany > 0) { #ifdef ON_THE_FLY_CONVERSION @@ -332,31 +312,3 @@ #endif if (send(sock, outBuff, howMany, 0) < 0) { -@@ -449,7 +714,7 @@ - FILE *tempFile; - size_t generatedBytes; - char tempStr[MAX_PATH_LEN+1]; -- char linkStr[MAX_PATH_LEN+1]; -+ char linkStr[MAX_PATH_LEN+2]; - time_t currTime; - char timeStr[256]; - -@@ -497,10 +762,16 @@ - if (strcmp(dp->d_name, ".")) /* not self */ - { - if (strcmp(dp->d_name, "..")) -+ { - strcpy(linkStr, dp->d_name); -- else -+ if (dp->d_type == DT_DIR) -+ strcat(linkStr, "/"); -+ sprintf(tempStr, "<A HREF=\"%s\">%s</A><BR>\n", linkStr, linkStr); -+ } else -+ { - strcpy(linkStr, "Parent Directory"); -- sprintf(tempStr, "<A HREF=\"%s\">%s</A><BR>\n", dp->d_name, linkStr); -+ sprintf(tempStr, "<A HREF=\"%s/\">%s</A><BR>\n", dp->d_name, linkStr); -+ } - generatedBytes += strlen(tempStr); - fprintf(tempFile, "%s\n", tempStr); - } diff --git a/www/pserv/files/patch-main.h b/www/pserv/files/patch-main.h index 4419788ac639..9a1fc269c5c4 100644 --- a/www/pserv/files/patch-main.h +++ b/www/pserv/files/patch-main.h @@ -1,6 +1,6 @@ ---- main.h.orig Fri Sep 19 00:36:03 2003 -+++ main.h Thu Oct 16 13:52:18 2003 -@@ -24,11 +24,12 @@ +--- main.h.orig Sun Oct 19 17:22:03 2003 ++++ main.h Tue Oct 21 00:19:57 2003 +@@ -27,11 +27,12 @@ /* --- CPP parsing options --- */ @@ -14,11 +14,11 @@ /* --- Configure options --- */ #define CONFIG_FILE_NAME "pserv.conf" -@@ -39,19 +40,19 @@ +@@ -42,19 +43,19 @@ #define MIME_TYPE_DEFAULT "application/octet-stream" /* configuration file location */ --#define DEFAULT_CONFIG_LOCATION "/export/home/multix/pserv/" +-#define DEFAULT_CONFIG_LOCATION "/home/multix/pserv/" -//#define DEFAULT_CONFIG_LOCATION "/Users/multix/Documents/code/pserv/" +#define DEFAULT_CONFIG_LOCATION "/usr/local/etc/" @@ -26,7 +26,7 @@ -#define DEFAULT_PORT 2000 +#define DEFAULT_PORT 80 #define DEFAULT_MAX_CHILDREN 5 --#define DEFAULT_DOCS_LOCATION "/export/home/multix/public_html" +-#define DEFAULT_DOCS_LOCATION "/home/multix/public_html" +#define DEFAULT_DOCS_LOCATION "/usr/local/www/data" #define DEFAULT_FILE_NAME "index.html" #define DEFAULT_SEC_TO 1 @@ -41,19 +41,18 @@ #define DEFAULT_SERVER_NAME "localhost" /* amount of connections queued in listening */ -@@ -120,9 +121,11 @@ +@@ -123,8 +124,10 @@ #define ADDRESS_LEN 16 #define METHOD_LEN 16 #define PROTOCOL_LEN 16 +#define CONTENT_TYPE_LEN 256 #define USER_AGENT_LEN 256 #define MAX_QUERY_STRING_LEN 1024 - #define MAX_PATH_LEN 1024 +#define MAX_COOKIE_LEN 4096 - struct request - { -@@ -133,7 +136,9 @@ + /* the maximum path name of your system should be available in MAXNAMLEN + defined in dirent.h. If not, set a reasonable value like 1024 */ +@@ -139,7 +142,9 @@ char protocolVersion[PROTOCOL_LEN+1]; int keepAlive; char userAgent[USER_AGENT_LEN+1]; diff --git a/www/pserv/files/patch-pserv.conf b/www/pserv/files/patch-pserv.conf index 1580f655cd41..410ae29dcf4d 100644 --- a/www/pserv/files/patch-pserv.conf +++ b/www/pserv/files/patch-pserv.conf @@ -1,17 +1,17 @@ ---- pserv.conf.orig Wed Oct 15 16:18:05 2003 -+++ pserv.conf Wed Oct 15 16:20:01 2003 +--- pserv.conf.orig Sun Oct 19 16:51:27 2003 ++++ pserv.conf Tue Oct 21 00:22:07 2003 @@ -1,9 +1,10 @@ --port 80 -+port 80 +-port 80 ++port 80 maxChildren 4 --documentsPath /export/home/multix/public_html +-documentsPath /home/multix/public_html +documentsPath %%PREFIX%%/www/data defaultFile index.html secTimeout 1 uSecTimeout 100000 --logFile /export/home/multix/pserv/pserv.log --mimeTypesFile /export/home/multix/pserv/mime_types.dat --cgiRoot /export/home/multix/public_html/cgi-bin +-logFile /home/multix/pserv/pserv.log +-mimeTypesFile /home/multix/pserv/mime_types.dat +-cgiRoot /home/multix/public_html/cgi-bin +logFile /var/log/pserv.log +mimeTypesFile %%PREFIX%%/etc/mime.types +phpFile %%LOCALBASE%%/bin/php |