From owner-freebsd-ports-bugs@FreeBSD.ORG Mon Oct 20 15:50:40 2003 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3D09B16A4C0 for ; Mon, 20 Oct 2003 15:50:40 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id CD49244015 for ; Mon, 20 Oct 2003 15:50:17 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h9KMoHFY032570 for ; Mon, 20 Oct 2003 15:50:17 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h9KMoHjb032566; Mon, 20 Oct 2003 15:50:17 -0700 (PDT) (envelope-from gnats) Resent-Date: Mon, 20 Oct 2003 15:50:17 -0700 (PDT) Resent-Message-Id: <200310202250.h9KMoHjb032566@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Alex Dupre Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5910916A4DD; Mon, 20 Oct 2003 15:41:49 -0700 (PDT) Received: from relay.gufi.org (civetta.gufi.org [212.110.23.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id DAD6043FEC; Mon, 20 Oct 2003 15:40:58 -0700 (PDT) (envelope-from alex@armada.alexdupre.com) Received: from armada.alexdupre.com (host245-49.pool8288.interbusiness.it [82.88.49.245]) by relay.gufi.org (Postfix) with ESMTP id 67A6420F0F; Tue, 21 Oct 2003 00:40:42 +0200 (CEST) Received: from armada.alexdupre.com (localhost [127.0.0.1]) h9KMeqIo003601; Tue, 21 Oct 2003 00:40:52 +0200 (CEST) (envelope-from alex@armada.alexdupre.com) Received: (from alex@localhost) by armada.alexdupre.com (8.12.10/8.12.10/Submit) id h9KMepw3003600; Tue, 21 Oct 2003 00:40:51 +0200 (CEST) (envelope-from alex) Message-Id: <200310202240.h9KMepw3003600@armada.alexdupre.com> Date: Tue, 21 Oct 2003 00:40:51 +0200 (CEST) From: Alex Dupre To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 cc: nork@FreeBSD.org Subject: ports/58310: [Maintainer Update] www/pserv X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Alex Dupre List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2003 22:50:40 -0000 >Number: 58310 >Category: ports >Synopsis: [Maintainer Update] www/pserv >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Mon Oct 20 15:50:17 PDT 2003 >Closed-Date: >Last-Modified: >Originator: Alex Dupre >Release: FreeBSD 5.1-CURRENT i386 >Organization: >Environment: System: FreeBSD armada.alexdupre.com 5.1-CURRENT FreeBSD 5.1-CURRENT #3: Mon Oct 20 18:11:07 CEST 2003 alex@armada.alexdupre.com:/usr/obj/usr/src/sys/ARMADA i386 >Description: Update to 3.0 b2. >How-To-Repeat: >Fix: --- pserv.diff begins here --- diff -ruN pserv.orig/Makefile pserv/Makefile --- pserv.orig/Makefile Tue Oct 21 00:01:23 2003 +++ pserv/Makefile Tue Oct 21 00:34:52 2003 @@ -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 -ruN pserv.orig/distinfo pserv/distinfo --- pserv.orig/distinfo Tue Oct 21 00:01:23 2003 +++ pserv/distinfo Tue Oct 21 00:01:50 2003 @@ -1 +1 @@ -MD5 (pserv-22-Sep-03.tar.Z) = 4895631b730836c9202d5ac28b05f0fa +MD5 (pserv-20-Oct-03.tar.Z) = 1b38238b8de0704b03ae245271f4899e diff -ruN pserv.orig/files/patch-Makefile pserv/files/patch-Makefile --- pserv.orig/files/patch-Makefile Tue Oct 21 00:01:23 2003 +++ pserv/files/patch-Makefile Tue Oct 21 00:07:48 2003 @@ -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 -ruN pserv.orig/files/patch-handlers.c pserv/files/patch-handlers.c --- pserv.orig/files/patch-handlers.c Tue Oct 21 00:01:23 2003 +++ pserv/files/patch-handlers.c Tue Oct 21 00:14:21 2003 @@ -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("\nCGI Error

Cgi Exec error

\n"); -+ printf("\nCGI Error

CGI Exec error

\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, "%s
\n", linkStr, linkStr); -+ } else -+ { - strcpy(linkStr, "Parent Directory"); -- sprintf(tempStr, "%s
\n", dp->d_name, linkStr); -+ sprintf(tempStr, "%s
\n", dp->d_name, linkStr); -+ } - generatedBytes += strlen(tempStr); - fprintf(tempFile, "%s\n", tempStr); - } diff -ruN pserv.orig/files/patch-main.h pserv/files/patch-main.h --- pserv.orig/files/patch-main.h Tue Oct 21 00:01:23 2003 +++ pserv/files/patch-main.h Tue Oct 21 00:20:19 2003 @@ -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 -ruN pserv.orig/files/patch-pserv.conf pserv/files/patch-pserv.conf --- pserv.orig/files/patch-pserv.conf Tue Oct 21 00:01:23 2003 +++ pserv/files/patch-pserv.conf Tue Oct 21 00:22:27 2003 @@ -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 --- pserv.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: