diff options
author | tron <tron> | 1999-09-03 21:07:36 +0000 |
---|---|---|
committer | tron <tron> | 1999-09-03 21:07:36 +0000 |
commit | bd885bd43fb1178c3e77c7d8d8d164f43cbdb05a (patch) | |
tree | df26111ab07656003d7eb1164580a43a7b69d202 /www | |
parent | 3ad5eb82b02778ff0c90980522c7b127a050bcca (diff) | |
download | pkgsrc-bd885bd43fb1178c3e77c7d8d8d164f43cbdb05a.tar.gz |
Update "wwwoffle" package to version 2.4 and add IPv6 support.
Patches supplied by Feico Dillema in PR pkg/8290.
Diffstat (limited to 'www')
-rw-r--r-- | www/wwwoffle/Makefile | 33 | ||||
-rw-r--r-- | www/wwwoffle/files/md5 | 4 | ||||
-rw-r--r-- | www/wwwoffle/files/patch-sum | 11 | ||||
-rw-r--r-- | www/wwwoffle/patches.v6/patch-ba | 115 | ||||
-rw-r--r-- | www/wwwoffle/patches.v6/patch-bb | 48 | ||||
-rw-r--r-- | www/wwwoffle/patches.v6/patch-bc | 48 | ||||
-rw-r--r-- | www/wwwoffle/patches.v6/patch-bd | 286 | ||||
-rw-r--r-- | www/wwwoffle/patches.v6/patch-be | 11 | ||||
-rw-r--r-- | www/wwwoffle/patches.v6/patch-bf | 53 | ||||
-rw-r--r-- | www/wwwoffle/patches.v6/patch-bg | 192 | ||||
-rw-r--r-- | www/wwwoffle/patches/patch-aa | 54 | ||||
-rw-r--r-- | www/wwwoffle/pkg/PLIST | 24 |
12 files changed, 850 insertions, 29 deletions
diff --git a/www/wwwoffle/Makefile b/www/wwwoffle/Makefile index 100f374e09b..e83a3edcabc 100644 --- a/www/wwwoffle/Makefile +++ b/www/wwwoffle/Makefile @@ -1,12 +1,12 @@ -# $NetBSD: Makefile,v 1.7 1999/04/21 10:08:20 tron Exp $ +# $NetBSD: Makefile,v 1.8 1999/09/03 21:07:36 tron Exp $ -DISTNAME= wwwoffle-2.2 +DISTNAME= wwwoffle-2.4 CATEGORIES= www MASTER_SITES= ftp://ftp.demon.co.uk/pub/unix/httpd/ \ - ftp://sunsite.unc.edu/pub/Linux/apps/www/servers/ + ${MASTER_SITE_SUNSITE:=apps/www/servers/} EXTRACT_SUFX= .tgz -MAINTAINER= magick@bundy.lip.owl.de +MAINTAINER= packages@netbsd.org HOMEPAGE= http://www.gedanken.demon.co.uk/wwwoffle/ USE_GMAKE= yes @@ -15,6 +15,21 @@ NO_CONFIGURE= yes MESSAGE_FILE= ${WRKDIR}/MESSAGE PLIST_SRC= ${WRKDIR}/PLIST +# to get USE_INET6 +.include "../../mk/bsd.prefs.mk" + +# IPv6 support +.if defined(USE_INET6) && ${USE_INET6} == YES +PATCHDIR= ${WRKDIR}/.patches +.endif + +pre-patch: +.if defined(USE_INET6) && ${USE_INET6} == YES + ${MKDIR} ${WRKDIR}/.patches + ${CP} ${.CURDIR}/patches/patch-* ${WRKDIR}/.patches + ${CP} ${.CURDIR}/patches.v6/patch-* ${WRKDIR}/.patches +.endif + post-build: @${SED} -e 's#@PREFIX@#${PREFIX}#g' <${FILESDIR}/wwwoffle.sh \ >${WRKDIR}/wwwoffle.sh @@ -26,9 +41,15 @@ pre-install: ${MKDIR} ${PREFIX}/etc/wwwoffle post-install: - ${CP} ${PREFIX}/etc/wwwoffle/wwwoffle.conf \ - ${PREFIX}/etc/wwwoffle/wwwoffle.conf.default + if [ -f ${PREFIX}/etc/wwwoffle/wwwoffle.conf.install ]; then \ + ${MV} ${PREFIX}/etc/wwwoffle/wwwoffle.conf.install \ + ${PREFIX}/etc/wwwoffle/wwwoffle.conf.default; \ + else \ + ${CP} -p ${PREFIX}/etc/wwwoffle/wwwoffle.conf \ + ${PREFIX}/etc/wwwoffle/wwwoffle.conf.default; \ + fi ${INSTALL_SCRIPT} ${WRKDIR}/wwwoffle.sh ${PREFIX}/etc/rc.d + ${CHOWN} -R ${BINOWN}:${BINGRP} /var/wwwoffle ${GTAR} czCf / ${PREFIX}/libdata/wwwoffle-spool.tar.gz var/wwwoffle .include "../../mk/bsd.pkg.mk" diff --git a/www/wwwoffle/files/md5 b/www/wwwoffle/files/md5 index 88bfd7e61f8..000530a7eca 100644 --- a/www/wwwoffle/files/md5 +++ b/www/wwwoffle/files/md5 @@ -1,3 +1,3 @@ -$NetBSD: md5,v 1.3 1998/08/07 13:27:43 agc Exp $ +$NetBSD: md5,v 1.4 1999/09/03 21:07:37 tron Exp $ -MD5 (wwwoffle-2.2.tgz) = 8409cdb2be9c5a7dcc2d51be1fd1a5d0 +MD5 (wwwoffle-2.4.tgz) = fbd0d04618b274ed5eac7977dfba6e3c diff --git a/www/wwwoffle/files/patch-sum b/www/wwwoffle/files/patch-sum index db4aab3443a..1f2e58d21d1 100644 --- a/www/wwwoffle/files/patch-sum +++ b/www/wwwoffle/files/patch-sum @@ -1,3 +1,10 @@ -$NetBSD: patch-sum,v 1.1 1999/07/09 14:23:20 agc Exp $ +$NetBSD: patch-sum,v 1.2 1999/09/03 21:07:37 tron Exp $ -MD5 (patch-aa) = 8eaeb4fec5939e0303a0a2bbc94894d2 +MD5 (patch-aa) = d24c472fed970b3c5c2d2535ed1aad26 +MD5 (patch-ba) = ab4d06ae815f748f3be946b140f62d88 +MD5 (patch-bb) = e5b9d9d1d94dc6ac1a37a3bf1c6eeb4a +MD5 (patch-bc) = 115f6a1e810c2dfc514fbb125dd655b4 +MD5 (patch-bd) = 023d42063d6ba1df7cbdf9534dad8aab +MD5 (patch-be) = a958ed08866d23879a77ab8c1477636c +MD5 (patch-bf) = f6ba5e9f8502b81a7c936a969e33792a +MD5 (patch-bg) = 81b95380eab0cb07046989e159b31a4b diff --git a/www/wwwoffle/patches.v6/patch-ba b/www/wwwoffle/patches.v6/patch-ba new file mode 100644 index 00000000000..fc0029b15dc --- /dev/null +++ b/www/wwwoffle/patches.v6/patch-ba @@ -0,0 +1,115 @@ +--- config.c.orig Sat Dec 5 11:52:07 1998 ++++ config.c Thu Aug 26 15:36:02 1999 +@@ -705,11 +705,15 @@ + localhost=(*LocalHost)->key.string; + else + localhost="localhost"; +- ++ + ret=(char*)malloc(strlen(localhost)+8); + +- if(port) +- sprintf(ret,"%s:%d",localhost,HTTP_Port); ++ if(port) { ++ if (strchr(localhost, ':')) ++ sprintf(ret,"[%s]:%d",localhost,HTTP_Port); ++ else ++ sprintf(ret,"%s:%d",localhost,HTTP_Port); ++ } + else + strcpy(ret,localhost); + +@@ -727,20 +731,32 @@ + int port If true then check the port number as well. + ++++++++++++++++++++++++++++++++++++++*/ + +-int IsLocalHost(char *host,int port) ++int IsLocalHost(char *hoststr,int port) + { + KeyPair **p; +- char *colon=strchr(host,':'); ++ char *escl, *escr, *host, *colon; + int isit=0; + +- if(colon) +- *colon=0; ++ escl=strchr(hoststr,'['); ++ escr=strrchr(hoststr,']'); ++ colon=strrchr(hoststr,':'); ++ host = hoststr; ++ ++ if (escl && escr) { ++ host = escl + 1; ++ *escr = 0; ++ } ++ else if(colon) ++ *colon=0; + + if(LocalHost) + for(p=LocalHost;(*p)!=&KeyPairEnd;p++) + if(!strcmp((*p)->key.string,host)) + {isit=1;break;} + ++ if (escl && escr) ++ *escr = ']'; ++ + if(colon) + *colon=':'; + +@@ -765,14 +781,23 @@ + char *host The name of the host (and port number) to be checked. + ++++++++++++++++++++++++++++++++++++++*/ + +-int IsLocalNetHost(char *host) ++int IsLocalNetHost(char *hoststr) + { + KeyPair **p; +- char *colon=strchr(host,':'); ++ char *escl, *escr, *host, *colon; + int isit=0; + +- if(colon) +- *colon=0; ++ escl=strchr(hoststr,'['); ++ escr=strrchr(hoststr,']'); ++ colon=strrchr(hoststr,':'); ++ host = hoststr; ++ ++ if (escl && escr) { ++ host = escl + 1; ++ *escr = 0; ++ } ++ else if(colon) ++ *colon=0; + + if(IsLocalHost(host,0)) + isit=1; +@@ -782,6 +807,10 @@ + if(wildcard_match(host,(*p)->key.string)) + {isit=1;break;} + ++ ++ if (escl && escr) ++ *escr = ']'; ++ + if(colon) + *colon=':'; + +@@ -2031,7 +2060,7 @@ + {errmsg=(char*)malloc(40);strcpy(errmsg,"Expecting a hostname, got nothing.");} + else + { +- char *colon=strchr(text,':'),*p; ++ char *colon = NULL,*p; + if(colon) + {errmsg=(char*)malloc(56+strlen(text));sprintf(errmsg,"Expecting a hostname not a port number, got '%s'.",text);} + else +@@ -2058,7 +2087,7 @@ + {errmsg=(char*)malloc(48);strcpy(errmsg,"Expecting a hostname (and port), got nothing.");} + else + { +- char *colon=strchr(text,':'),*p; ++ char *colon=strrchr(text,':'),*p; + if(*text==':') + {errmsg=(char*)malloc(48+strlen(text));sprintf(errmsg,"Expecting a hostname before the ':', got '%s'.",text);} + else diff --git a/www/wwwoffle/patches.v6/patch-bb b/www/wwwoffle/patches.v6/patch-bb new file mode 100644 index 00000000000..fc749dca560 --- /dev/null +++ b/www/wwwoffle/patches.v6/patch-bb @@ -0,0 +1,48 @@ +--- http.c.orig Tue Aug 24 19:42:55 1999 ++++ http.c Wed Aug 25 20:43:50 1999 +@@ -44,8 +44,8 @@ + char *HTTP_Open(URL *Url) + { + char *msg=NULL; +- char *colon; +- char *server_host=NULL; ++ char *colon, *escr, *escl; ++ char *server_host, *host; + int server_port=Protocols[Protocol_HTTP].defport; + + proxy=WhichProxy(Url->proto,Url->host); +@@ -63,7 +63,19 @@ + strcpy(server_host,Url->host); + } + +- if((colon=strchr(server_host,':'))) ++ escl=strchr(server_host,'['); ++ escr=strrchr(server_host,']'); ++ if (escr && escl) { ++ *escr=0; ++ host = escl+1; ++ colon = strrchr(escr+1,':'); ++ } ++ else { ++ host = server_host; ++ colon = strrchr(server_host,':'); ++ } ++ ++ if(colon) + { + *colon++=0; + if(*colon) +@@ -72,11 +84,11 @@ + + /* Open the connection. */ + +- server=OpenClientSocket(server_host,server_port); ++ server=OpenClientSocket(host,server_port); + init_buffer(server); + + if(server==-1) +- msg=PrintMessage(Warning,"Cannot open the HTTP connection to %s port %d; [%!s].",server_host,server_port); ++ msg=PrintMessage(Warning,"Cannot open the HTTP connection to %s port %d; [%!s].",host,server_port); + + free(server_host); + diff --git a/www/wwwoffle/patches.v6/patch-bc b/www/wwwoffle/patches.v6/patch-bc new file mode 100644 index 00000000000..8a1dddf3ed1 --- /dev/null +++ b/www/wwwoffle/patches.v6/patch-bc @@ -0,0 +1,48 @@ +--- misc.c.orig Tue Aug 24 19:50:58 1999 ++++ misc.c Tue Aug 24 20:24:24 1999 +@@ -44,7 +44,7 @@ + URL *Url=(URL*)malloc(sizeof(URL)); + char *copyurl,*mallocurl=malloc(strlen(url)+2); + int i=0,n=0; +- char *colon,*slash,*at,*temppath,root[2]; ++ char *colon,*slash,*escr,*at,*temppath,root[2]; + + copyurl=mallocurl; + strcpy(copyurl,url); +@@ -174,12 +174,17 @@ + strcpy(Url->host,copyurl); + } + +- for(i=0;Url->host[i] && Url->host[i]!=':';i++) ++ colon=strrchr(Url->host,':'); ++ escr=strrchr(Url->host,']'); ++ if (escr && colon < escr) ++ colon = strrchr(escr+1,':'); ++ ++ for(i=0;Url->host[i] && (i != colon - Url->host);i++) + Url->host[i]=tolower(Url->host[i]); + +- if(Url->host[i]==':') +- if(atoi(&Url->host[i+1])==(Url->Protocol?Url->Protocol->defport:80)) +- Url->host[i]=0; ++ if(colon) ++ if(atoi(colon+1)==(Url->Protocol?Url->Protocol->defport:80)) ++ *colon=0; + + if(!Url->local && IsLocalHost(Url->host,1) && Url->Protocol && Url->Protocol==&Protocols[0]) + { +@@ -394,12 +399,13 @@ + *match=0; + + match=&path[strlen(path)-3]; +- if(match>=path && !strcmp(match,"/..")) ++ if(match>=path && !strcmp(match,"/..")) { + if(match==path) + *match=0; + else + while(match>path && *--match!='/') + *match=0; ++ } + + new=(char*)malloc(strlen(Url->proto)+strlen(Url->host)+strlen(path)+8); + sprintf(new,"%s://%s%s",Url->proto,Url->host,path); diff --git a/www/wwwoffle/patches.v6/patch-bd b/www/wwwoffle/patches.v6/patch-bd new file mode 100644 index 00000000000..1e8212e6f42 --- /dev/null +++ b/www/wwwoffle/patches.v6/patch-bd @@ -0,0 +1,286 @@ +--- sockets.c.orig Mon Aug 23 17:02:36 1999 ++++ sockets.c Wed Aug 25 18:20:28 1999 +@@ -15,6 +15,7 @@ + + #include <stdio.h> + #include <string.h> ++#include <stdlib.h> + + #include <errno.h> + #include <unistd.h> +@@ -44,47 +45,79 @@ + int OpenClientSocket(char* host, int port) + { + int s; +- int retval,err=0; +- struct sockaddr_in server; +- struct hostent* hp; +- int retries=4; +- +- server.sin_family=AF_INET; +- server.sin_port=htons((unsigned short)port); +- +- hp=gethostbyname(host); +- if(!hp) +- { +- unsigned long int addr=inet_addr(host); +- if(addr!=-1) +- hp=gethostbyaddr((char*)addr,sizeof(addr),AF_INET); +- +- if(!hp) +- {errno=-1;PrintMessage(Warning,"Unknown host '%s' for server [%!s].",host);return(-1);} +- } +- memcpy((char*)&server.sin_addr,(char*)hp->h_addr,sizeof(server.sin_addr)); +- +- do{ +- s=socket(PF_INET,SOCK_STREAM,0); +- if(s==-1) +- {PrintMessage(Warning,"Cannot create client socket [%!s].");return(-1);} +- +- retval=connect(s,(struct sockaddr *)&server,sizeof(server)); +- if(retval==-1) +- { +- err=errno; +- if(--retries && errno==ECONNREFUSED) +- PrintMessage(Inform,"Connect fail [%!s]; trying again."); +- else +- PrintMessage(Warning,"Connect fail [%!s]."); +- close(s); +- s=-1; +- sleep(1); +- } +- } +- while(retval==-1 && retries && err==ECONNREFUSED); +- +- return(s); ++ int connected, err; ++ struct addrinfo hints, *r, *res; ++ char *aport; ++ ++ err = asprintf(&aport, "%d", port); ++ if (err < 0) { ++ errno=-1; ++ PrintMessage(Warning,"Memory Alloc Fails [%!s]."); ++ return(-1); ++ } ++ ++ memset(&hints, 0, sizeof(hints)); ++ hints.ai_flags = AI_NUMERICHOST; ++ hints.ai_family = AF_UNSPEC; ++ hints.ai_socktype= SOCK_STREAM; ++ err = getaddrinfo(host, aport, &hints, &res); ++ if (!err) { ++ /*numeric*/ ++ freeaddrinfo(res); ++ memset(&hints, 0, sizeof(hints)); ++ hints.ai_flags = AI_CANONNAME; ++ hints.ai_family = AF_UNSPEC; ++ hints.ai_socktype = SOCK_STREAM; ++ hints.ai_protocol = 0; ++ err = getaddrinfo(host, aport, &hints, &res); ++ } else { ++ /*non-numeric*/ ++ memset(&hints, 0, sizeof(hints)); ++ hints.ai_family = AF_UNSPEC; ++ hints.ai_socktype = SOCK_STREAM; ++ hints.ai_protocol = 0; ++ err = getaddrinfo(host, aport, &hints, &res); ++ } ++ if (err) { ++ if (aport) free(aport); ++ if (res) freeaddrinfo(res); ++ errno=-1; ++ PrintMessage(Warning,"%s '%s', server [%!s].", gai_strerror(err), host); ++ return(-1); ++ } ++ ++ err = 0; ++ s = -1; ++ connected = 0; ++ for (r = res; r && !connected; r = r->ai_next) { ++ s = socket(r->ai_family, r->ai_socktype, r->ai_protocol); ++ if (s < 0) { ++ PrintMessage(Warning,"Cannot create client socket [%!s]."); ++ continue; ++ } ++ ++ if (connect(s, r->ai_addr, r->ai_addrlen) < 0) { ++ PrintMessage(Inform,"Connect fail [%!s]; continue trying."); ++ err = errno; ++ s = -1; ++ close(s); ++ continue; ++ } ++ PrintMessage(Inform,"Connected ok to client [%!s]."); ++ ++ connected++; ++ break; ++ } ++ ++ if (res) freeaddrinfo(res); ++ if (aport) free(aport); ++ ++ if (s < 0 || connected == 0) { ++ PrintMessage(Warning,"OSC Connect fail [%!s]."); ++ return (-1); /* error */ ++ } ++ ++ return (s); + } + + +@@ -96,30 +129,72 @@ + int port The port number to use. + ++++++++++++++++++++++++++++++++++++++*/ + +-int OpenServerSocket(int port) ++int *OpenServerSockets(int port) + { +- int s; +- int retval; +- struct sockaddr_in server; +- int reuse_addr=1; +- +- s=socket(PF_INET,SOCK_STREAM,0); +- if(s==-1) +- {PrintMessage(Warning,"Cannot create server socket [%!s].");return(-1);} +- +- setsockopt(s,SOL_SOCKET,SO_REUSEADDR,&reuse_addr,sizeof(reuse_addr)); ++ int *s, *slist, maxs, error; ++ int reuse_addr = 1; ++ struct addrinfo hints, *r, *res; ++ char *aport; ++ ++ error = asprintf(&aport, "%d", port); ++ if (error < 0) { ++ errno = -1; ++ PrintMessage(Warning,"Memory Alloc Fails [%!s]."); ++ return(NULL); ++ } ++ ++ memset(&hints, 0, sizeof(hints)); ++ hints.ai_flags = AI_PASSIVE; ++ hints.ai_family = AF_UNSPEC; ++ hints.ai_socktype = SOCK_STREAM; ++ hints.ai_protocol = 0; ++ error = getaddrinfo(NULL, aport, &hints, &res); ++ ++ if (aport) ++ free (aport); ++ ++ if (error) { ++ errno = -1; ++ PrintMessage(Warning,"%s [%!s].",gai_strerror(error)); ++ return(NULL); ++ } ++ ++ for (maxs = 0, r = res; r; r = r->ai_next, maxs++); ++ slist = malloc ((maxs+1) * sizeof(int)); ++ if (!slist) { ++ errno = -1; ++ PrintMessage(Warning,"Memory Alloc Fails [%!s]."); ++ return(NULL); ++ } ++ slist[0] = maxs; /* max. num of sockets */ ++ ++ s = slist+1; ++ for (r = res; r; r = r->ai_next) { ++ *s = socket(r->ai_family, r->ai_socktype, r->ai_protocol); ++ if (*s < 0) { ++ PrintMessage(Warning,"Cannot create server socket [%!s]."); ++ continue; ++ } ++ setsockopt(*s,SOL_SOCKET,SO_REUSEADDR,&reuse_addr,sizeof(reuse_addr)); ++ ++ if (bind(*s, r->ai_addr, r->ai_addrlen) < 0) { ++ PrintMessage(Warning,"Failed to bind server socket [%!s]."); ++ close (*s); ++ continue; ++ } ++ ++ listen(*s,4); ++ s++; ++ } ++ ++ if (slist[0] < 0) { ++ PrintMessage(Warning,"Failed to bind server socket [%!s]."); ++ free (slist); ++ errno = -1; ++ return NULL; ++ } + +- server.sin_family=AF_INET; +- server.sin_addr.s_addr=INADDR_ANY; +- server.sin_port=htons((unsigned int)port); +- +- retval=bind(s,(struct sockaddr*)&server,sizeof(server)); +- if(retval==-1) +- {PrintMessage(Warning,"Failed to bind server socket [%!s].");return(-1);} +- +- listen(s,4); +- +- return(s); ++ return (slist); + } + + +@@ -160,34 +235,36 @@ + + int SocketRemoteName(int socket,char **name,char **ipname,int *port) + { +- struct sockaddr_in server; ++ struct sockaddr_storage server; + int length=sizeof(server),retval; +- static char host[MAXHOSTNAMELEN],ip[16]; +- struct hostent* hp=NULL; ++ static char host[NI_MAXHOST],ip[NI_MAXHOST],portstr[NI_MAXSERV]; + +- retval=getpeername(socket,(struct sockaddr*)&server,&length); +- if(retval==-1) +- PrintMessage(Warning,"Failed to get socket peername [%!s]."); ++ retval = getpeername(socket,(struct sockaddr*)&server,&length); ++ if(retval) ++ PrintMessage(Warning,"Failed to get socket peername [%!s]."); + else +- { +- hp=gethostbyaddr((char*)&server.sin_addr,sizeof(server.sin_addr),AF_INET); +- if(hp) +- strcpy(host,hp->h_name); +- else +- strcpy(host,inet_ntoa(server.sin_addr)); +- +- strcpy(ip,inet_ntoa(server.sin_addr)); +- +- if(name) +- *name=host; ++ { ++ retval = getnameinfo((struct sockaddr*)&server, length, host, ++ NI_MAXHOST, NULL, 0, 0); ++ if (retval) ++ retval = getnameinfo((struct sockaddr*)&server, length, ip, ++ NI_MAXHOST, portstr, NI_MAXSERV, ++ NI_NUMERICHOST|NI_NUMERICSERV); ++ if (retval) ++ PrintMessage(Warning,"Failed Name Lookup [%!s]: %s.", gai_strerror(retval)); ++ else ++ { ++ if(name) ++ *name=host; + #ifdef __CYGWIN__ +- if(!strcmp(ip,"127.0.0.1")) +- *name="localhost"; ++ if(!strcmp(ip,"127.0.0.1")) ++ *name="localhost"; + #endif +- if(ipname) +- *ipname=ip; +- if(port) +- *port=ntohs(server.sin_port); ++ if(ipname) ++ *ipname=ip; ++ if(port) ++ *port=atoi(portstr); ++ } + } + + return(retval); diff --git a/www/wwwoffle/patches.v6/patch-be b/www/wwwoffle/patches.v6/patch-be new file mode 100644 index 00000000000..851e0ba92fd --- /dev/null +++ b/www/wwwoffle/patches.v6/patch-be @@ -0,0 +1,11 @@ +--- sockets.h.orig Mon Aug 23 19:34:19 1999 ++++ sockets.h Mon Aug 23 19:33:57 1999 +@@ -20,7 +20,7 @@ + + int OpenClientSocket(char* host, int port); + +-int OpenServerSocket(int port); ++int *OpenServerSockets(int port); + int AcceptConnect(int socket); + + int SocketRemoteName(int socket,char **name,char **ipname,int *port); diff --git a/www/wwwoffle/patches.v6/patch-bf b/www/wwwoffle/patches.v6/patch-bf new file mode 100644 index 00000000000..e8981233030 --- /dev/null +++ b/www/wwwoffle/patches.v6/patch-bf @@ -0,0 +1,53 @@ +--- wwwoffle.c.orig Tue Aug 24 19:33:32 1999 ++++ wwwoffle.c Tue Aug 24 19:41:22 1999 +@@ -216,7 +216,7 @@ + + if(!strcmp(argv[i],"-p")) + { +- char *colon; ++ char *colon, *escr, *escl; + + if(++i>=argc) + {fprintf(stderr,"wwwoffle: The '-p' argument requires a hostname and optionally a port number.\n"); exit(1);} +@@ -224,7 +224,7 @@ + if(ConfigFile) + {fprintf(stderr,"wwwoffle: The '-p' and '-c' options cannot be used together.\n"); exit(1);} + +- if((colon=strchr(argv[i],':'))) ++ if((colon=strrchr(argv[i],':'))) + { + *colon++=0; + +@@ -234,7 +234,14 @@ + {fprintf(stderr,"wwwoffle: The port number %d '%s' is invalid.\n",port,argv[i]); exit(1);} + } + +- host=argv[i]; ++ escl=strchr(argv[i],'['); ++ escr=strrchr(argv[i],']'); ++ if (escl && escr) { ++ host=escl+1; ++ *escr=0; ++ } ++ else ++ host=argv[i]; + + argv[i-1]=NULL; + argv[i]=NULL; +@@ -344,12 +351,12 @@ + host=(char*)malloc(strlen(env)+1); + strcpy(host,env); + +- if((colon1=strchr(host,':'))) ++ if((colon2=strrchr(host,':'))) + { +- *colon1=0; +- if((colon2=strchr(colon1+1,':'))) ++ *colon2=0; ++ if((colon1=strchr(host,':'))) + { +- *colon2=0; ++ *colon1=0; + if(action==Get || action==Output || action==OutputWithHeader) + port=atoi(colon1+1); + else diff --git a/www/wwwoffle/patches.v6/patch-bg b/www/wwwoffle/patches.v6/patch-bg new file mode 100644 index 00000000000..0315cea3908 --- /dev/null +++ b/www/wwwoffle/patches.v6/patch-bg @@ -0,0 +1,192 @@ +--- wwwoffled.c.orig Tue Aug 24 12:16:05 1999 ++++ wwwoffled.c Wed Aug 25 10:06:03 1999 +@@ -49,8 +49,8 @@ + + + /*+ The server sockets that we listen on +*/ +-int http_fd=-1, /*+ for the HTTP connections. +*/ +- wwwoffle_fd=-1; /*+ for the WWWOFFLE connections. +*/ ++int *http_fd_list, http_fd, /*+ for the HTTP connections. +*/ ++ *wwwoffle_fd_list, wwwoffle_fd; /*+ for the WWWOFFLE connections. +*/ + + /*+ The online / offline /autodial status. +*/ + int online=0; +@@ -154,12 +154,12 @@ + if(WWWOFFLE_Gid != -1 || WWWOFFLE_Uid != -1) + PrintMessage(Inform,"Running with uid=%d, gid=%d.",getuid(),getgid()); + +- http_fd=OpenServerSocket(HTTP_Port); +- if(http_fd==-1) ++ http_fd_list=OpenServerSockets(HTTP_Port); ++ if(!http_fd_list) + PrintMessage(Fatal,"Cannot create HTTP server socket."); + +- wwwoffle_fd=OpenServerSocket(WWWOFFLE_Port); +- if(wwwoffle_fd==-1) ++ wwwoffle_fd_list=OpenServerSockets(WWWOFFLE_Port); ++ if(!wwwoffle_fd_list) + PrintMessage(Fatal,"Cannot create WWWOFFLE server socket."); + + if(stat(SpoolDir,&buf)) +@@ -192,20 +192,29 @@ + { + struct timeval tv; + fd_set readfd; ++ int fd, i; + int nfds; + int retval; + +- if(http_fd>wwwoffle_fd) +- nfds=http_fd+1; +- else +- nfds=wwwoffle_fd+1; ++ fd = http_fd_list[1]; ++ for (i = 1; i <= http_fd_list[0]; i++) { ++ if (!fd || fd < http_fd_list[i]) ++ fd = http_fd_list[i]; ++ } ++ for (i = 1; i <= wwwoffle_fd_list[0]; i++) { ++ if (!fd || fd < wwwoffle_fd_list[i]) ++ fd = wwwoffle_fd_list[i]; ++ } ++ nfds=fd+1; + + FD_ZERO(&readfd); + +- FD_SET(wwwoffle_fd,&readfd); ++ for (i = 1; i <= wwwoffle_fd_list[0]; i++) ++ FD_SET(wwwoffle_fd_list[i],&readfd); + + if(n_servers<MaxServers) +- FD_SET(http_fd,&readfd); ++ for (i = 1; i <= http_fd_list[0]; i++) ++ FD_SET(http_fd_list[i],&readfd); + + tv.tv_sec=10; + tv.tv_usec=0; +@@ -214,56 +223,62 @@ + + if(retval!=-1) + { +- if(FD_ISSET(wwwoffle_fd,&readfd)) +- { +- char *host,*ip; +- int port,client; +- +- client=AcceptConnect(wwwoffle_fd); +- init_buffer(client); +- +- if(client>=0 && !SocketRemoteName(client,&host,&ip,&port)) +- { +- if(IsAllowedConnectHost(host) || IsAllowedConnectHost(ip)) +- { +- PrintMessage(Important,"WWWOFFLE Connection from host %s (%s).",host,ip); /* Used in audit-usage.pl */ +- +- CommandConnect(client); +- +- if(fetch_fd!=client) +- CloseSocket(client); +- } +- else +- { +- PrintMessage(Warning,"WWWOFFLE Connection rejected from host %s (%s).",host,ip); /* Used in audit-usage.pl */ +- CloseSocket(client); +- } +- } +- } +- +- if(FD_ISSET(http_fd,&readfd)) +- { +- char *host,*ip; +- int port,client; +- +- client=AcceptConnect(http_fd); +- init_buffer(client); +- +- if(client>=0 && !SocketRemoteName(client,&host,&ip,&port)) +- { +- if(IsAllowedConnectHost(host) || IsAllowedConnectHost(ip)) +- { +- PrintMessage(Inform,"HTTP Proxy connection from host %s (%s).",host,ip); /* Used in audit-usage.pl */ +- ForkServer(client,1); +- } +- else +- PrintMessage(Warning,"HTTP Proxy connection rejected from host %s (%s).",host,ip); /* Used in audit-usage.pl */ +- +- CloseSocket(client); +- } +- } ++ for (i = 1; i <= wwwoffle_fd_list[0]; i++) { ++ wwwoffle_fd = wwwoffle_fd_list[i]; ++ if(FD_ISSET(wwwoffle_fd,&readfd)) ++ { ++ char *host,*ip; ++ int port,client; ++ ++ client=AcceptConnect(wwwoffle_fd); ++ init_buffer(client); ++ ++ if(client>=0 && !SocketRemoteName(client,&host,&ip,&port)) ++ { ++ if(IsAllowedConnectHost(host) || IsAllowedConnectHost(ip)) ++ { ++ PrintMessage(Important,"WWWOFFLE Connection from host %s (%s).",host,ip); /* Used in audit-usage.pl */ ++ ++ CommandConnect(client); ++ ++ if(fetch_fd!=client) ++ CloseSocket(client); ++ } ++ else ++ { ++ PrintMessage(Warning,"WWWOFFLE Connection rejected from host %s (%s).",host,ip); /* Used in audit-usage.pl */ ++ CloseSocket(client); ++ } ++ } ++ } ++ } ++ for (i = 1; i <= http_fd_list[0]; i++) { ++ http_fd = http_fd_list[i]; ++ ++ if(FD_ISSET(http_fd,&readfd)) ++ { ++ char *host,*ip; ++ int port,client; ++ ++ client=AcceptConnect(http_fd); ++ init_buffer(client); ++ ++ if(client>=0 && !SocketRemoteName(client,&host,&ip,&port)) ++ { ++ if(IsAllowedConnectHost(host) || IsAllowedConnectHost(ip)) ++ { ++ PrintMessage(Inform,"HTTP Proxy connection from host %s (%s).",host,ip); /* Used in audit-usage.pl */ ++ ForkServer(client,1); ++ } ++ else ++ PrintMessage(Warning,"HTTP Proxy connection rejected from host %s (%s).",host,ip); /* Used in audit-usage.pl */ ++ ++ CloseSocket(client); ++ } ++ } ++ } + } +- ++ + if(readconfig) + { + readconfig=0; +@@ -342,9 +357,11 @@ + while(!closedown); + + /* Close down and exit. */ ++ for (i = 1; i <= wwwoffle_fd_list[0]; i++) ++ CloseSocket(wwwoffle_fd_list[i]); + +- CloseSocket(http_fd); +- CloseSocket(wwwoffle_fd); ++ for (i = 1; i <= http_fd_list[0]; i++) ++ CloseSocket(http_fd_list[i]); + + if(n_servers) + PrintMessage(Important,"Exit signalled - waiting for children."); diff --git a/www/wwwoffle/patches/patch-aa b/www/wwwoffle/patches/patch-aa index d149daa34f9..dbaa5adbe8d 100644 --- a/www/wwwoffle/patches/patch-aa +++ b/www/wwwoffle/patches/patch-aa @@ -1,10 +1,10 @@ -$NetBSD: patch-aa,v 1.3 1998/08/07 11:14:29 agc Exp $ +$NetBSD: patch-aa,v 1.4 1999/09/03 21:07:37 tron Exp $ ---- Makefile.orig Mon Jun 15 20:58:24 1998 -+++ Makefile Sat Jul 11 23:42:20 1998 -@@ -14,17 +14,17 @@ +--- Makefile.orig Thu Dec 3 20:19:46 1998 ++++ Makefile Fri Sep 3 22:42:44 1999 +@@ -16,9 +16,9 @@ - ######## + LOCALHOST=localhost:8080 -INSTDIR=/usr/local -SPOOLDIR=/var/spool/wwwoffle @@ -13,24 +13,50 @@ $NetBSD: patch-aa,v 1.3 1998/08/07 11:14:29 agc Exp $ +SPOOLDIR=/var/wwwoffle +CONFDIR=${PREFIX}/etc/wwwoffle + # For Cygwin (win32) + #INSTDIR=/wwwoffle +@@ -28,13 +28,13 @@ ######## CC=gcc -CFLAGS=-O2 -Wall -g +CFLAGS=-O2 -Wall + # This is used in the FreeBSD port (http://www.freebsd.org/ports/) + #CFLAGS=-O2 -Wall + LD=gcc -LDFLAGS=-g +LDFLAGS=-s + # For HP/UX this is a good idea. #LDFLAGS= +@@ -236,15 +236,15 @@ + $(INSTALL) -c -m 644 wwwoffle.conf.man.install $(INSTDIR)/man/man5/wwwoffle.conf.5 + [ -x $(INSTDIR)/man/man8 ] || $(INSTALL) -d $(INSTDIR)/man/man8 + $(INSTALL) -c -m 644 wwwoffled.man $(INSTDIR)/man/man8/wwwoffled.8 +- [ -x $(INSTDIR)/doc/wwwoffle ] || $(INSTALL) -d $(INSTDIR)/doc/wwwoffle ++ [ -x $(INSTDIR)/share/doc/wwwoffle ] || $(INSTALL) -d $(INSTDIR)/share/doc/wwwoffle + for file in CHANGES.CONF CONVERT COPYING FAQ INSTALL NEWS README* UPGRADE ; do \ +- $(INSTALL) -c -m 644 $$file $(INSTDIR)/doc/wwwoffle/$$file ;\ ++ $(INSTALL) -c -m 644 $$file $(INSTDIR)/share/doc/wwwoffle/$$file ;\ + done + + install_doc-win32 : +- [ -x $(INSTDIR)/doc ] || $(INSTALL) -d $(INSTDIR)/doc ++ [ -x $(INSTDIR)/share/doc ] || $(INSTALL) -d $(INSTDIR)/share/doc + for file in CHANGES.CONF COPYING INSTALL FAQ NEWS README* ; do \ +- $(INSTALL) -c -m 644 $$file $(INSTDIR)/doc/$$file ;\ ++ $(INSTALL) -c -m 644 $$file $(INSTDIR)/share/doc/$$file ;\ + done + $(INSTALL) -c -m 644 README.win32 $(CONFDIR)/README.win32 + +@@ -300,7 +300,7 @@ + [ -f $(CONFDIR)/wwwoffle.conf ] || $(INSTALL) -c -m 644 wwwoffle.conf.install $(CONFDIR)/wwwoffle.conf -@@ -240,7 +240,7 @@ - [ -e $(SPOOLDIR)/html -a ! -e $(SPOOLDIR)/html.old ] && mv $(SPOOLDIR)/html $(SPOOLDIR)/html.old ;\ - [ ! -e $(SPOOLDIR)/html ] && mkdir $(SPOOLDIR)/html - @for f in html/* ; do \ -- cp -a $$f $(SPOOLDIR)/$$f && echo "Installing $(SPOOLDIR)/$$f";\ -+ cp -R $$f $(SPOOLDIR)/$$f && echo "Installing $(SPOOLDIR)/$$f";\ - done - @([ -d $(SPOOLDIR) -a ! -d $(SPOOLDIR)/prevtime1 ] && ./endian-cache > /dev/null 2>&1 ) || \ - (echo "WWWOFFLE: " ;\ + install_fixup-win32: +- for file in $(INSTDIR)/doc/* $(CONFDIR)/README.win32 ; do \ ++ for file in $(INSTDIR)/share/doc/* $(CONFDIR)/README.win32 ; do \ + [ -f $$file ] && awk '{print $$0 "\r";}' < $$file > $$file.txt && rm -f $$file ;\ + done + for file in $(CONFDIR)/wwwoffle.conf ; do \ diff --git a/www/wwwoffle/pkg/PLIST b/www/wwwoffle/pkg/PLIST index 768a63c3660..674dcefd9af 100644 --- a/www/wwwoffle/pkg/PLIST +++ b/www/wwwoffle/pkg/PLIST @@ -1,18 +1,32 @@ -@comment $NetBSD: PLIST,v 1.3 1999/04/20 20:06:50 tron Exp $ +@comment $NetBSD: PLIST,v 1.4 1999/09/03 21:07:38 tron Exp $ bin/wwwoffle -bin/wwwoffle-tools bin/wwwoffle-ls bin/wwwoffle-mv +bin/wwwoffle-read bin/wwwoffle-rm +bin/wwwoffle-tools +bin/wwwoffle-write etc/rc.d/wwwoffle.sh etc/wwwoffle/wwwoffle.conf.default -@exec cp -p %F %D/etc/wwwoffle/wwwoffle.conf -@unexec rm -f %D/etc/wwwoffle/wwwoffle.conf +@exec if [ ! -f %D/etc/wwwoffle/wwwoffle.conf ]; then cp -p %D/etc/wwwoffle/wwwoffle.conf.default %D/etc/wwwoffle/wwwoffle.conf; fi libdata/wwwoffle-spool.tar.gz man/man1/wwwoffle.1 man/man5/wwwoffle.conf.5 man/man8/wwwoffled.8 sbin/wwwoffled -@dirrm etc/wwwoffle +share/doc/wwwoffle/CHANGES.CONF +share/doc/wwwoffle/CONVERT +share/doc/wwwoffle/COPYING +share/doc/wwwoffle/FAQ +share/doc/wwwoffle/INSTALL +share/doc/wwwoffle/NEWS +share/doc/wwwoffle/README +share/doc/wwwoffle/README.1st +share/doc/wwwoffle/README.CONF +share/doc/wwwoffle/README.PWD +share/doc/wwwoffle/README.htdig +share/doc/wwwoffle/README.win32 +share/doc/wwwoffle/UPGRADE +@dirrm share/doc/wwwoffle @exec @GTAR@ xzCf / %D/libdata/wwwoffle-spool.tar.gz @unexec rm -rf /var/wwwoffle |