FreeBSD Bugzilla – Attachment 36345 Details for
Bug 58310
[Maintainer Update] www/pserv
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
pserv.diff
pserv.diff (text/plain), 10.67 KB, created by
Alex Dupre
on 2003-10-20 23:50:17 UTC
(
hide
)
Description:
pserv.diff
Filename:
MIME Type:
Creator:
Alex Dupre
Created:
2003-10-20 23:50:17 UTC
Size:
10.67 KB
patch
obsolete
>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("\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 -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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 58310
: 36345