diff options
author | itohy <itohy@pkgsrc.org> | 1999-11-26 06:09:00 +0000 |
---|---|---|
committer | itohy <itohy@pkgsrc.org> | 1999-11-26 06:09:00 +0000 |
commit | b3a20c16133d1c23d03bf5dde7bfdcc0fab7b0ae (patch) | |
tree | e57bb8b6b5b3e68337d0c0287c295841cacb85f1 /www/wwwoffle | |
parent | a8d0caf5c399f5c5d0852f5cfa3de414c9111b5b (diff) | |
download | pkgsrc-b3a20c16133d1c23d03bf5dde7bfdcc0fab7b0ae.tar.gz |
- Update to 2.5b.
Based on PR #8562 by Feico Dillema.
- Do not automatically remove the cache on un-installation.
Diffstat (limited to 'www/wwwoffle')
-rw-r--r-- | www/wwwoffle/Makefile | 8 | ||||
-rw-r--r-- | www/wwwoffle/files/md5 | 4 | ||||
-rw-r--r-- | www/wwwoffle/files/patch-sum | 19 | ||||
-rw-r--r-- | www/wwwoffle/patches.v6/patch-ba | 20 | ||||
-rw-r--r-- | www/wwwoffle/patches.v6/patch-bb | 10 | ||||
-rw-r--r-- | www/wwwoffle/patches.v6/patch-bc | 21 | ||||
-rw-r--r-- | www/wwwoffle/patches.v6/patch-bd | 471 | ||||
-rw-r--r-- | www/wwwoffle/patches.v6/patch-be | 8 | ||||
-rw-r--r-- | www/wwwoffle/patches.v6/patch-bf | 14 | ||||
-rw-r--r-- | www/wwwoffle/patches.v6/patch-bg | 16 | ||||
-rw-r--r-- | www/wwwoffle/patches.v6/patch-bh | 133 | ||||
-rw-r--r-- | www/wwwoffle/patches/patch-aa | 29 | ||||
-rw-r--r-- | www/wwwoffle/pkg/PLIST | 7 |
13 files changed, 524 insertions, 236 deletions
diff --git a/www/wwwoffle/Makefile b/www/wwwoffle/Makefile index c27207aa1c7..cc833b13b73 100644 --- a/www/wwwoffle/Makefile +++ b/www/wwwoffle/Makefile @@ -1,6 +1,6 @@ -# $NetBSD: Makefile,v 1.9 1999/09/03 21:57:49 tron Exp $ +# $NetBSD: Makefile,v 1.10 1999/11/26 06:09:00 itohy Exp $ -DISTNAME= wwwoffle-2.4 +DISTNAME= wwwoffle-2.5b CATEGORIES= www MASTER_SITES= ftp://ftp.demon.co.uk/pub/unix/httpd/ \ ${MASTER_SITE_SUNSITE:=apps/www/servers/} @@ -52,6 +52,8 @@ post-install: 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 + # directories other than html are automatically created at run time + ${GTAR} czCf / ${PREFIX}/libdata/wwwoffle-spool.tar.gz \ + var/wwwoffle/html var/wwwoffle/outgoing .include "../../mk/bsd.pkg.mk" diff --git a/www/wwwoffle/files/md5 b/www/wwwoffle/files/md5 index 000530a7eca..1f95a34d098 100644 --- a/www/wwwoffle/files/md5 +++ b/www/wwwoffle/files/md5 @@ -1,3 +1,3 @@ -$NetBSD: md5,v 1.4 1999/09/03 21:07:37 tron Exp $ +$NetBSD: md5,v 1.5 1999/11/26 06:09:01 itohy Exp $ -MD5 (wwwoffle-2.4.tgz) = fbd0d04618b274ed5eac7977dfba6e3c +MD5 (wwwoffle-2.5b.tgz) = 45cac8f1c09b91f08e139acac212acfd diff --git a/www/wwwoffle/files/patch-sum b/www/wwwoffle/files/patch-sum index 87100ba1d3c..9d3cd226bc9 100644 --- a/www/wwwoffle/files/patch-sum +++ b/www/wwwoffle/files/patch-sum @@ -1,10 +1,11 @@ -$NetBSD: patch-sum,v 1.3 1999/09/03 21:10:53 tron Exp $ +$NetBSD: patch-sum,v 1.4 1999/11/26 06:09:01 itohy Exp $ -MD5 (patch-aa) = d24c472fed970b3c5c2d2535ed1aad26 -MD5 (patch-ba) = 18452024b6834859f89f14de20a9bb17 -MD5 (patch-bb) = 0792b65583adb52ff035b47664b4c408 -MD5 (patch-bc) = eb7423aea039efaf7f2646d434b2e148 -MD5 (patch-bd) = 2079be61d9eb5d938d3ff8cb0b001966 -MD5 (patch-be) = 8b61623ec0f2f3554ed3b14dad355170 -MD5 (patch-bf) = 83f76154bcb7e1c5f574e9e33398be1e -MD5 (patch-bg) = 9d2492b9b70dcc4d5a3232b076a2c60f +MD5 (patch-aa) = 2f8dab0f46e80bfa5d9a05172354b62d +MD5 (patch-ba) = 697b7cad9f1cd82c4b74da1317f4f987 +MD5 (patch-bb) = 06fd1d3b05e51f2594d97c4213b897ae +MD5 (patch-bc) = 1b57de22607a54791e72ad411cc2ba79 +MD5 (patch-bd) = 526ecc28c80aaaf26fd5fc34893a97fa +MD5 (patch-be) = 0a1d40853dc4b1efaff7d96981efad2d +MD5 (patch-bf) = 757112e555a41d0365eaaf85d177dadd +MD5 (patch-bg) = b0fceece78a62c8a59e7efc20b0f3dfc +MD5 (patch-bh) = 1241dca0eb0e06a56ad2bee04c4b0591 diff --git a/www/wwwoffle/patches.v6/patch-ba b/www/wwwoffle/patches.v6/patch-ba index 94244151230..c2e68ba56ea 100644 --- a/www/wwwoffle/patches.v6/patch-ba +++ b/www/wwwoffle/patches.v6/patch-ba @@ -1,8 +1,8 @@ -$NetBSD: patch-ba,v 1.2 1999/09/03 21:10:54 tron Exp $ +$NetBSD: patch-ba,v 1.3 1999/11/26 06:09:01 itohy Exp $ ---- config.c.orig Sat Dec 5 11:52:07 1998 -+++ config.c Thu Aug 26 15:36:02 1999 -@@ -705,11 +705,15 @@ +--- config.c.orig Thu Sep 23 01:31:33 1999 ++++ config.c Thu Nov 25 20:00:34 1999 +@@ -798,11 +798,15 @@ localhost=(*LocalHost)->key.string; else localhost="localhost"; @@ -21,7 +21,7 @@ $NetBSD: patch-ba,v 1.2 1999/09/03 21:10:54 tron Exp $ else strcpy(ret,localhost); -@@ -727,20 +731,32 @@ +@@ -821,20 +825,32 @@ int port If true then check the port number as well. ++++++++++++++++++++++++++++++++++++++*/ @@ -58,7 +58,7 @@ $NetBSD: patch-ba,v 1.2 1999/09/03 21:10:54 tron Exp $ if(colon) *colon=':'; -@@ -765,14 +781,23 @@ +@@ -859,14 +875,23 @@ char *host The name of the host (and port number) to be checked. ++++++++++++++++++++++++++++++++++++++*/ @@ -86,8 +86,8 @@ $NetBSD: patch-ba,v 1.2 1999/09/03 21:10:54 tron Exp $ if(IsLocalHost(host,0)) isit=1; -@@ -782,6 +807,10 @@ - if(wildcard_match(host,(*p)->key.string)) +@@ -881,6 +906,10 @@ + else if(wildcard_match(host,(*p)->key.string)) {isit=1;break;} + @@ -97,7 +97,7 @@ $NetBSD: patch-ba,v 1.2 1999/09/03 21:10:54 tron Exp $ if(colon) *colon=':'; -@@ -2031,7 +2060,7 @@ +@@ -2192,7 +2221,7 @@ {errmsg=(char*)malloc(40);strcpy(errmsg,"Expecting a hostname, got nothing.");} else { @@ -106,7 +106,7 @@ $NetBSD: patch-ba,v 1.2 1999/09/03 21:10:54 tron Exp $ 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 @@ +@@ -2219,7 +2248,7 @@ {errmsg=(char*)malloc(48);strcpy(errmsg,"Expecting a hostname (and port), got nothing.");} else { diff --git a/www/wwwoffle/patches.v6/patch-bb b/www/wwwoffle/patches.v6/patch-bb index 8c7b9d8790b..25528a523eb 100644 --- a/www/wwwoffle/patches.v6/patch-bb +++ b/www/wwwoffle/patches.v6/patch-bb @@ -1,7 +1,7 @@ -$NetBSD: patch-bb,v 1.2 1999/09/03 21:10:54 tron Exp $ +$NetBSD: patch-bb,v 1.3 1999/11/26 06:09:01 itohy Exp $ ---- http.c.orig Tue Aug 24 19:42:55 1999 -+++ http.c Wed Aug 25 20:43:50 1999 +--- http.c.orig Sun Oct 24 18:05:45 1999 ++++ http.c Thu Nov 25 20:00:34 1999 @@ -44,8 +44,8 @@ char *HTTP_Open(URL *Url) { @@ -38,8 +38,8 @@ $NetBSD: patch-bb,v 1.2 1999/09/03 21:10:54 tron Exp $ /* Open the connection. */ -- server=OpenClientSocket(server_host,server_port); -+ server=OpenClientSocket(host,server_port); +- server=OpenClientSocket(server_host,server_port,ConnectTimeout); ++ server=OpenClientSocket(host,server_port,ConnectTimeout); init_buffer(server); if(server==-1) diff --git a/www/wwwoffle/patches.v6/patch-bc b/www/wwwoffle/patches.v6/patch-bc index db2f3737f90..88175deeeac 100644 --- a/www/wwwoffle/patches.v6/patch-bc +++ b/www/wwwoffle/patches.v6/patch-bc @@ -1,7 +1,7 @@ -$NetBSD: patch-bc,v 1.2 1999/09/03 21:10:54 tron Exp $ +$NetBSD: patch-bc,v 1.3 1999/11/26 06:09:01 itohy Exp $ ---- misc.c.orig Tue Aug 24 19:50:58 1999 -+++ misc.c Tue Aug 24 20:24:24 1999 +--- misc.c.orig Thu Jul 8 01:37:57 1999 ++++ misc.c Thu Nov 25 20:00:34 1999 @@ -44,7 +44,7 @@ URL *Url=(URL*)malloc(sizeof(URL)); char *copyurl,*mallocurl=malloc(strlen(url)+2); @@ -33,18 +33,3 @@ $NetBSD: patch-bc,v 1.2 1999/09/03 21:10:54 tron Exp $ 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 index fec6e6ca1a5..bb8fb7aae74 100644 --- a/www/wwwoffle/patches.v6/patch-bd +++ b/www/wwwoffle/patches.v6/patch-bd @@ -1,7 +1,7 @@ -$NetBSD: patch-bd,v 1.2 1999/09/03 21:10:54 tron Exp $ +$NetBSD: patch-bd,v 1.3 1999/11/26 06:09:01 itohy Exp $ ---- sockets.c.orig Mon Aug 23 17:02:36 1999 -+++ sockets.c Wed Aug 25 18:20:28 1999 +--- sockets.c.orig Tue Jul 6 03:46:16 1999 ++++ sockets.c Thu Nov 25 20:00:36 1999 @@ -15,6 +15,7 @@ #include <stdio.h> @@ -10,15 +10,20 @@ $NetBSD: patch-bd,v 1.2 1999/09/03 21:10:54 tron Exp $ #include <errno.h> #include <unistd.h> -@@ -44,47 +45,79 @@ - int OpenClientSocket(char* host, int port) +@@ -47,93 +48,133 @@ + + int OpenClientSocket(char* host, int port,int timeout) { - int s; -- int retval,err=0; +- int s; +- int retval; - struct sockaddr_in server; - struct hostent* hp; -- int retries=4; -- ++ int s = -1; ++ int connected, err; ++ struct addrinfo hints, *r, *res = NULL; + int noblock,flags; ++ char *aport = NULL; + - server.sin_family=AF_INET; - server.sin_port=htons((unsigned short)port); - @@ -34,31 +39,10 @@ $NetBSD: patch-bd,v 1.2 1999/09/03 21:10:54 tron Exp $ - } - 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); +- s=socket(PF_INET,SOCK_STREAM,0); +- if(s==-1) +- {PrintMessage(Warning,"Cannot create client socket [%!s].");return(-1);} - -- return(s); -+ int connected, err; -+ struct addrinfo hints, *r, *res; -+ char *aport; -+ + err = asprintf(&aport, "%d", port); + if (err < 0) { + errno=-1; @@ -71,9 +55,13 @@ $NetBSD: patch-bd,v 1.2 1999/09/03 21:10:54 tron Exp $ + hints.ai_family = AF_UNSPEC; + hints.ai_socktype= SOCK_STREAM; + err = getaddrinfo(host, aport, &hints, &res); ++ if (res) { ++ freeaddrinfo(res); ++ res = NULL; ++ } ++ + if (!err) { + /*numeric*/ -+ freeaddrinfo(res); + memset(&hints, 0, sizeof(hints)); + hints.ai_flags = AI_CANONNAME; + hints.ai_family = AF_UNSPEC; @@ -88,50 +76,153 @@ $NetBSD: patch-bd,v 1.2 1999/09/03 21:10:54 tron Exp $ + hints.ai_protocol = 0; + err = getaddrinfo(host, aport, &hints, &res); + } ++ + if (err) { -+ if (aport) free(aport); -+ if (res) freeaddrinfo(res); -+ errno=-1; ++ s = -1; errno=-1; + PrintMessage(Warning,"%s '%s', server [%!s].", gai_strerror(err), host); -+ return(-1); + } ++ else { ++ 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; ++ } + #ifdef O_NONBLOCK +- flags=fcntl(s,F_GETFL,0); +- if(flags!=-1) +- noblock=fcntl(s,F_SETFL,flags|O_NONBLOCK); +- else +- noblock=-1; ++ flags=fcntl(s,F_GETFL,0); ++ if(flags!=-1) ++ noblock=fcntl(s,F_SETFL,flags|O_NONBLOCK); ++ else ++ noblock=-1; + #else +- flags=1; +- noblock=ioctl(s,FIONBIO,&flags); ++ flags=1; ++ noblock=ioctl(s,FIONBIO,&flags); + #endif + +- retval=connect(s,(struct sockaddr *)&server,sizeof(server)); +- +- if(retval==-1 && noblock!=-1 && errno==EINPROGRESS) +- { +- fd_set writefd; +- struct timeval tv; +- +- FD_ZERO(&writefd); +- FD_SET(s,&writefd); +- +- tv.tv_sec=timeout; +- tv.tv_usec=0; +- +- retval=select(s+1,NULL,&writefd,NULL,&tv); +- +- if(retval>0) +- { +- int arglen=sizeof(int); +- +- if(getsockopt(s,SOL_SOCKET,SO_ERROR,&retval,&arglen)<0) +- retval=errno; +- +- if(retval!=0) +- errno=retval,retval=-1; +- if(errno==EINPROGRESS) +- errno=ETIMEDOUT; +- } +- else if(retval==0) +- errno=ETIMEDOUT,retval=-1; +- } +- +- if(retval<0) +- { +- close(s); +- s=-1; +- +- PrintMessage(Warning,"Connect fail [%!s]."); +- } +- else +- { ++ err = connect(s, r->ai_addr, r->ai_addrlen); ++ if(err==-1 && noblock!=-1 && errno==EINPROGRESS) ++ { ++ fd_set writefd; ++ struct timeval tv; + -+ 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; -+ } ++ FD_ZERO(&writefd); ++ FD_SET(s,&writefd); + -+ 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]."); ++ tv.tv_sec=timeout; ++ tv.tv_usec=0; + -+ connected++; -+ break; -+ } ++ err=select(s+1,NULL,&writefd,NULL,&tv); ++ ++ if(err>0) ++ { ++ int arglen=sizeof(int); ++ ++ if(getsockopt(s,SOL_SOCKET,SO_ERROR,&err,&arglen)<0) ++ err=errno; + ++ if(err!=0) ++ errno=err,err=-1; ++ if(errno==EINPROGRESS) ++ errno=ETIMEDOUT; ++ } ++ else if(err==0) ++ errno=ETIMEDOUT,err=-1; ++ } ++ ++ if(err<0) ++ { ++ close(s); ++ s=-1; ++ ++ PrintMessage(Warning,"Connect fail [%!s]."); ++ continue; ++ } ++ else ++ { + #ifdef O_NONBLOCK +- flags=fcntl(s,F_GETFL,0); +- if(flags!=-1) +- fcntl(s,F_SETFL,flags&~O_NONBLOCK); ++ flags=fcntl(s,F_GETFL,0); ++ if(flags!=-1) ++ fcntl(s,F_SETFL,flags&~O_NONBLOCK); + #else +- flags=0; +- ioctl(s,FIONBIO,&flags); ++ flags=0; ++ ioctl(s,FIONBIO,&flags); + #endif +- } +- +- return(s); ++ } ++ ++ PrintMessage(Inform,"Connected ok to client [%!s]."); ++ connected++; ++ break; ++ } ++ if (!connected) s = -1; ++ } + if (res) freeaddrinfo(res); + if (aport) free(aport); + -+ if (s < 0 || connected == 0) { -+ PrintMessage(Warning,"OSC Connect fail [%!s]."); -+ return (-1); /* error */ -+ } ++ if (s < 0) ++ PrintMessage(Warning,"OSC Connect fail [%!s]."); + + return (s); } -@@ -96,30 +129,72 @@ +@@ -145,30 +186,75 @@ int port The port number to use. ++++++++++++++++++++++++++++++++++++++*/ @@ -148,77 +239,79 @@ $NetBSD: patch-bd,v 1.2 1999/09/03 21:10:54 tron Exp $ - {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; +- +- server.sin_family=AF_INET; +- server.sin_addr.s_addr=INADDR_ANY; +- server.sin_port=htons((unsigned int)port); ++ int *s = NULL, *slist = NULL, maxs, error; + int reuse_addr = 1; -+ struct addrinfo hints, *r, *res; -+ char *aport; ++ struct addrinfo hints, *r = NULL, *res; ++ char *aport = NULL; + + error = asprintf(&aport, "%d", port); -+ if (error < 0) { -+ errno = -1; ++ if (error < 0) + PrintMessage(Warning,"Memory Alloc Fails [%!s]."); -+ return(NULL); -+ } ++ else { ++ 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 (error) ++ PrintMessage(Warning,"%s [%!s].",gai_strerror(error)); ++ if (aport) ++ free (aport); + -+ 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 (!error) { ++ for (maxs = 0, r = res; r; r = r->ai_next, maxs++); ++ slist = malloc ((maxs+1) * sizeof(int)); ++ if (!slist) ++ PrintMessage(Warning,"Memory Alloc Fails [%!s]."); ++ else { ++ slist[0] = 0; /* counting number of sockets */ + -+ if (aport) -+ free (aport); ++ 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; ++ } ++ if (listen(*s, 4) < 0) { ++ close (*s); ++ continue; ++ } ++ slist[0] = slist[0] + 1; ++ s++; ++ } ++ } ++ } else ++ slist = NULL; ++ } + -+ 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 (res) freeaddrinfo(res); + -+ if (slist[0] < 0) { -+ PrintMessage(Warning,"Failed to bind server socket [%!s]."); -+ free (slist); -+ errno = -1; -+ return NULL; -+ } ++ if (slist && !slist[0]) { ++ PrintMessage(Warning,"Failed to bind server socket [%!s]."); ++ free (slist); ++ slist = 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);} -- ++ if (!slist) ++ errno = -1; + - listen(s,4); - - return(s); @@ -226,24 +319,19 @@ $NetBSD: patch-bd,v 1.2 1999/09/03 21:10:54 tron Exp $ } -@@ -160,34 +235,36 @@ +@@ -209,35 +295,43 @@ int SocketRemoteName(int socket,char **name,char **ipname,int *port) { - struct sockaddr_in server; -+ struct sockaddr_storage server; - int length=sizeof(server),retval; +- 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 +- else - { - hp=gethostbyaddr((char*)&server.sin_addr,sizeof(server.sin_addr),AF_INET); - if(hp) @@ -252,37 +340,116 @@ $NetBSD: patch-bd,v 1.2 1999/09/03 21:10:54 tron Exp $ - strcpy(host,inet_ntoa(server.sin_addr)); - - strcpy(ip,inet_ntoa(server.sin_addr)); -- ++ struct sockaddr_storage server; ++ int length=sizeof(server),retval,error; ++ static char host[NI_MAXHOST],ip[NI_MAXHOST],portstr[NI_MAXSERV]; ++ ++ error = getpeername(socket,(struct sockaddr*)&server,&length); ++ if(error) { ++ PrintMessage(Warning,"Failed to get socket peername [%!s]."); ++ retval = error; ++ } else { ++ error = getnameinfo((struct sockaddr*)&server, length, host, ++ NI_MAXHOST, NULL, 0, 0); ++ retval = getnameinfo((struct sockaddr*)&server, length, ip, ++ NI_MAXHOST, NULL, 0, NI_NUMERICHOST); ++ if (error) ++ retval = error; ++ ++ error = getnameinfo((struct sockaddr*)&server, length, NULL, 0, ++ portstr, NI_MAXSERV, 0); ++ ++ if (error) ++ retval = getnameinfo((struct sockaddr*)&server, length, ip, ++ NI_MAXHOST, portstr, NI_MAXSERV, ++ NI_NUMERICSERV); ++ if (retval) ++ PrintMessage(Warning,"Failed Name Lookup [%!s]: %s.", gai_strerror(retval)); + - 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; ++ if(name) ++ *name=host; #ifdef __CYGWIN__ - if(!strcmp(ip,"127.0.0.1")) - *name="localhost"; -+ 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); -+ } - } +- } ++ if(ipname) ++ *ipname=ip; ++ if(port) ++ *port=atoi(portstr); ++ } return(retval); + } +@@ -259,37 +353,35 @@ + + int SocketLocalName(int socket,char **name,char **ipname,int *port) + { +- struct sockaddr_in server; +- int length=sizeof(server),retval; +- static char host[MAXHOSTNAMELEN],ip[16]; +- struct hostent* hp=NULL; +- +- retval=getsockname(socket,(struct sockaddr*)&server,&length); +- if(retval==-1) +- PrintMessage(Warning,"Failed to get socket name [%!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)); +- ++ struct sockaddr_storage server; ++ int length=sizeof(server), retval, error; ++ static char host[NI_MAXHOST],ip[NI_MAXHOST],portstr[NI_MAXSERV]; ++ ++ error = getsockname(socket,(struct sockaddr*)&server,&length); ++ if(error) { ++ retval = error; ++ PrintMessage(Warning,"Failed to get socket name [%!s]."); ++ } ++ else { ++ error = name ? getnameinfo((struct sockaddr*)&server, length, host, ++ NI_MAXHOST, NULL, 0, 0) : 0; ++ retval = ipname ? getnameinfo((struct sockaddr*)&server, length, ip, ++ NI_MAXHOST, NULL, NI_MAXSERV, NI_NUMERICHOST) : 0; ++ if (error) ++ retval = error; ++ ++ retval = port ? getnameinfo((struct sockaddr*)&server, length, NULL, 0, ++ portstr, NI_MAXSERV, NI_NUMERICSERV) : 0; ++ } ++ + if(name) +- *name=host; +-#ifdef __CYGWIN__ +- if(!strcmp(ip,"127.0.0.1")) +- *name="localhost"; +-#endif ++ *name=host; + if(ipname) +- *ipname=ip; ++ *ipname=ip; + if(port) +- *port=ntohs(server.sin_port); +- } +- +- return(retval); ++ *port=atoi(portstr); ++ ++ return(retval); + } + + diff --git a/www/wwwoffle/patches.v6/patch-be b/www/wwwoffle/patches.v6/patch-be index 952957d8096..6302807685d 100644 --- a/www/wwwoffle/patches.v6/patch-be +++ b/www/wwwoffle/patches.v6/patch-be @@ -1,10 +1,10 @@ -$NetBSD: patch-be,v 1.2 1999/09/03 21:10:54 tron Exp $ +$NetBSD: patch-be,v 1.3 1999/11/26 06:09:01 itohy Exp $ ---- sockets.h.orig Mon Aug 23 19:34:19 1999 -+++ sockets.h Mon Aug 23 19:33:57 1999 +--- sockets.h.orig Tue Jul 6 03:46:16 1999 ++++ sockets.h Thu Nov 25 20:00:36 1999 @@ -20,7 +20,7 @@ - int OpenClientSocket(char* host, int port); + int OpenClientSocket(char* host, int port,int timeout); -int OpenServerSocket(int port); +int *OpenServerSockets(int port); diff --git a/www/wwwoffle/patches.v6/patch-bf b/www/wwwoffle/patches.v6/patch-bf index 403bb69ce1c..9e91869247c 100644 --- a/www/wwwoffle/patches.v6/patch-bf +++ b/www/wwwoffle/patches.v6/patch-bf @@ -1,8 +1,8 @@ -$NetBSD: patch-bf,v 1.2 1999/09/03 21:10:54 tron Exp $ +$NetBSD: patch-bf,v 1.3 1999/11/26 06:09:01 itohy Exp $ ---- wwwoffle.c.orig Tue Aug 24 19:33:32 1999 -+++ wwwoffle.c Tue Aug 24 19:41:22 1999 -@@ -216,7 +216,7 @@ +--- wwwoffle.c.orig Fri Oct 15 18:26:54 1999 ++++ wwwoffle.c Thu Nov 25 20:00:36 1999 +@@ -245,7 +245,7 @@ if(!strcmp(argv[i],"-p")) { @@ -11,7 +11,7 @@ $NetBSD: patch-bf,v 1.2 1999/09/03 21:10:54 tron Exp $ if(++i>=argc) {fprintf(stderr,"wwwoffle: The '-p' argument requires a hostname and optionally a port number.\n"); exit(1);} -@@ -224,7 +224,7 @@ +@@ -253,7 +253,7 @@ if(ConfigFile) {fprintf(stderr,"wwwoffle: The '-p' and '-c' options cannot be used together.\n"); exit(1);} @@ -20,7 +20,7 @@ $NetBSD: patch-bf,v 1.2 1999/09/03 21:10:54 tron Exp $ { *colon++=0; -@@ -234,7 +234,14 @@ +@@ -263,7 +263,14 @@ {fprintf(stderr,"wwwoffle: The port number %d '%s' is invalid.\n",port,argv[i]); exit(1);} } @@ -36,7 +36,7 @@ $NetBSD: patch-bf,v 1.2 1999/09/03 21:10:54 tron Exp $ argv[i-1]=NULL; argv[i]=NULL; -@@ -344,12 +351,12 @@ +@@ -379,12 +386,12 @@ host=(char*)malloc(strlen(env)+1); strcpy(host,env); diff --git a/www/wwwoffle/patches.v6/patch-bg b/www/wwwoffle/patches.v6/patch-bg index 49bbdb060cf..8631a1c63aa 100644 --- a/www/wwwoffle/patches.v6/patch-bg +++ b/www/wwwoffle/patches.v6/patch-bg @@ -1,7 +1,7 @@ -$NetBSD: patch-bg,v 1.2 1999/09/03 21:10:54 tron Exp $ +$NetBSD: patch-bg,v 1.3 1999/11/26 06:09:01 itohy Exp $ ---- wwwoffled.c.orig Tue Aug 24 12:16:05 1999 -+++ wwwoffled.c Wed Aug 25 10:06:03 1999 +--- wwwoffled.c.orig Sun Aug 8 18:22:33 1999 ++++ wwwoffled.c Thu Nov 25 20:00:36 1999 @@ -49,8 +49,8 @@ @@ -13,7 +13,7 @@ $NetBSD: patch-bg,v 1.2 1999/09/03 21:10:54 tron Exp $ /*+ The online / offline /autodial status. +*/ int online=0; -@@ -154,12 +154,12 @@ +@@ -169,12 +169,12 @@ if(WWWOFFLE_Gid != -1 || WWWOFFLE_Uid != -1) PrintMessage(Inform,"Running with uid=%d, gid=%d.",getuid(),getgid()); @@ -29,8 +29,8 @@ $NetBSD: patch-bg,v 1.2 1999/09/03 21:10:54 tron Exp $ + if(!wwwoffle_fd_list) PrintMessage(Fatal,"Cannot create WWWOFFLE server socket."); - if(stat(SpoolDir,&buf)) -@@ -192,20 +192,29 @@ + umask(0); +@@ -209,20 +209,29 @@ { struct timeval tv; fd_set readfd; @@ -66,7 +66,7 @@ $NetBSD: patch-bg,v 1.2 1999/09/03 21:10:54 tron Exp $ tv.tv_sec=10; tv.tv_usec=0; -@@ -214,56 +223,62 @@ +@@ -231,56 +240,62 @@ if(retval!=-1) { @@ -178,7 +178,7 @@ $NetBSD: patch-bg,v 1.2 1999/09/03 21:10:54 tron Exp $ if(readconfig) { readconfig=0; -@@ -342,9 +357,11 @@ +@@ -369,9 +384,11 @@ while(!closedown); /* Close down and exit. */ diff --git a/www/wwwoffle/patches.v6/patch-bh b/www/wwwoffle/patches.v6/patch-bh new file mode 100644 index 00000000000..7556d4b41ae --- /dev/null +++ b/www/wwwoffle/patches.v6/patch-bh @@ -0,0 +1,133 @@ +$NetBSD: patch-bh,v 1.1 1999/11/26 06:09:01 itohy Exp $ + +--- ftp.c.orig Sat Sep 11 23:00:02 1999 ++++ ftp.c Thu Nov 25 20:00:36 1999 +@@ -473,52 +473,87 @@ + + /* Create the data connection. */ + +- if(write_string(server_ctrl,"PASV\r\n")==-1) +- { +- msg=PrintMessage(Warning,"Failed to write 'PASV' command to remote FTP host [%!s]."); +- return(msg); +- } ++ if(write_string(server_ctrl,"EPSV\r\n")==-1) { ++ msg=PrintMessage(Warning,"Failed to write 'EPSV' command to remote FTP host [%!s]."); ++ return(msg); ++ } + + do +- { +- str=read_line_or_timeout(server_ctrl,str,SocketTimeout); +- PrintMessage(ExtraDebug,"FTP: sent 'PASV'; got: %s",str); +- } ++ { ++ str=read_line_or_timeout(server_ctrl,str,SocketTimeout); ++#if DEBUG_FTP ++ PrintMessage(Debug,"FTP: sent 'EPSV'; got: %s",str); ++#endif ++ } + while(str && (!isdigit(str[0]) || !isdigit(str[1]) || !isdigit(str[2]) || str[3]!=' ')); + +- if(!str || atoi(str)!=227) +- { +- if(str) +- { +- char *p=str+strlen(str)-1; +- while(*p=='\n' || *p=='\r') *p--=0; +- msg=PrintMessage(Warning,"Got '%s' message after sending 'PASV' command",str); +- } +- else +- msg=PrintMessage(Warning,"No reply from FTP server to 'PASV' command; timed out?"); +- return(msg); +- } ++ if(!str) { ++ msg=PrintMessage(Warning,"No reply from FTP server to 'EPSV' command; timed out?"); ++ return(msg); ++ } ++ ++ if(atoi(str) == 229) { ++ host=strchr(str,'(') + 1; ++ if(sscanf(host,"%*c%*c%*c%d%*c",&port_h) != 1) { ++ char *p=str+strlen(str)-1; ++ while(*p=='\n' || *p=='\r') *p--=0; ++ msg=PrintMessage(Warning,"Got '%s' message after sending 'EPSV' command, cannot parse %d.",str, port_h); ++ return(msg); ++ } ++ if (SocketRemoteName(server_ctrl, &host, NULL, NULL)) { ++ msg=PrintMessage(Warning,"Cannot determine server address."); ++ return(msg); ++ } ++ } else if (atoi(str) != 500) { ++ char *p=str+strlen(str)-1; ++ ++ while(*p=='\n' || *p=='\r') *p--=0; ++ msg=PrintMessage(Warning,"Got '%s' message after sending 'EPSV' command",str); ++ return(msg); ++ } else { /* Let's try PASV instead then */ ++ if(write_string(server_ctrl,"PASV\r\n")==-1) { ++ msg=PrintMessage(Warning,"Failed to write 'PASV' command to remote FTP host [%!s]."); ++ return(msg); ++ } ++ ++ do ++ { ++ str=read_line_or_timeout(server_ctrl,str,SocketTimeout); ++#if DEBUG_FTP ++ PrintMessage(Debug,"FTP: sent 'PASV'; got: %s",str); ++#endif ++ } ++ while(str && (!isdigit(str[0]) || !isdigit(str[1]) || !isdigit(str[2]) || str[3]!=' ')); ++ ++ if(!str) { ++ msg=PrintMessage(Warning,"No reply from FTP server to 'PASV' command; timed out?"); ++ return(msg); ++ } ++ ++ if(atoi(str) == 227) { ++ ++ if((host=strchr(str,','))) ++ { ++ while(isdigit(*--host)); ++ host++; ++ } ++ ++ if(!host || sscanf(host,"%*d,%*d,%*d,%*d%n,%d,%d",&l,&port_h,&port_l)!=2) ++ { ++ char *p=str+strlen(str)-1; ++ while(*p=='\n' || *p=='\r') *p--=0; ++ msg=PrintMessage(Warning,"Got '%s' message after sending 'PASV' command, cannot parse.",str); ++ return(msg); ++ } ++ port_h = port_l+256*port_h; ++ host[l]=0; ++ for(;l>0;l--) ++ if(host[l]==',') ++ host[l]='.'; ++ } ++ } + +- if((host=strchr(str,','))) +- { +- while(isdigit(*--host)); +- host++; +- } +- +- if(!host || sscanf(host,"%*d,%*d,%*d,%*d%n,%d,%d",&l,&port_h,&port_l)!=2) +- { +- char *p=str+strlen(str)-1; +- while(*p=='\n' || *p=='\r') *p--=0; +- msg=PrintMessage(Warning,"Got '%s' message after sending 'PASV' command, cannot parse.",str); +- return(msg); +- } +- +- host[l]=0; +- for(;l>0;l--) +- if(host[l]==',') +- host[l]='.'; +- +- server_data=OpenClientSocket(host,port_l+256*port_h,ConnectTimeout); ++ server_data=OpenClientSocket(host, port_h,ConnectTimeout); + init_buffer(server_data); + + if(server_data==-1) diff --git a/www/wwwoffle/patches/patch-aa b/www/wwwoffle/patches/patch-aa index dbaa5adbe8d..09fcd16da24 100644 --- a/www/wwwoffle/patches/patch-aa +++ b/www/wwwoffle/patches/patch-aa @@ -1,7 +1,7 @@ -$NetBSD: patch-aa,v 1.4 1999/09/03 21:07:37 tron Exp $ +$NetBSD: patch-aa,v 1.5 1999/11/26 06:09:01 itohy Exp $ ---- Makefile.orig Thu Dec 3 20:19:46 1998 -+++ Makefile Fri Sep 3 22:42:44 1999 +--- Makefile.orig Sun Oct 10 23:31:50 1999 ++++ Makefile Thu Nov 25 20:00:34 1999 @@ -16,9 +16,9 @@ LOCALHOST=localhost:8080 @@ -15,7 +15,7 @@ $NetBSD: patch-aa,v 1.4 1999/09/03 21:07:37 tron Exp $ # For Cygwin (win32) #INSTDIR=/wwwoffle -@@ -28,13 +28,13 @@ +@@ -37,13 +37,13 @@ ######## CC=gcc @@ -31,7 +31,7 @@ $NetBSD: patch-aa,v 1.4 1999/09/03 21:07:37 tron Exp $ # For HP/UX this is a good idea. #LDFLAGS= -@@ -236,15 +236,15 @@ +@@ -272,13 +272,13 @@ $(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 @@ -41,22 +41,19 @@ $NetBSD: patch-aa,v 1.4 1999/09/03 21:07:37 tron Exp $ - $(INSTALL) -c -m 644 $$file $(INSTDIR)/doc/wwwoffle/$$file ;\ + $(INSTALL) -c -m 644 $$file $(INSTDIR)/share/doc/wwwoffle/$$file ;\ done + [ "x$(LANG)" = "x" ] || [ ! -d lang-$(LANG) ] || ( cd lang-$(LANG) && \ + for file in CHANGES.CONF CONVERT COPYING FAQ INSTALL NEWS README* UPGRADE ; do \ +- [ ! -f $$file ] || $(INSTALL) -c -m 644 $$file $(INSTDIR)/doc/wwwoffle/$$file-$(LANG) ;\ ++ [ ! -f $$file ] || $(INSTALL) -c -m 644 $$file $(INSTDIR)/share/doc/wwwoffle/$$file-$(LANG) ;\ + 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 +@@ -348,7 +348,7 @@ + [ -f $(CONFDIR)/wwwoffle.conf ] || $(INSTALL) -c -m 640 wwwoffle.conf.install $(CONFDIR)/wwwoffle.conf 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 \ + # for file in $(CONFDIR)/wwwoffle.conf ; do \ diff --git a/www/wwwoffle/pkg/PLIST b/www/wwwoffle/pkg/PLIST index 674dcefd9af..12bfde4f819 100644 --- a/www/wwwoffle/pkg/PLIST +++ b/www/wwwoffle/pkg/PLIST @@ -1,4 +1,4 @@ -@comment $NetBSD: PLIST,v 1.4 1999/09/03 21:07:38 tron Exp $ +@comment $NetBSD: PLIST,v 1.5 1999/11/26 06:09:01 itohy Exp $ bin/wwwoffle bin/wwwoffle-ls bin/wwwoffle-mv @@ -26,7 +26,10 @@ share/doc/wwwoffle/README.CONF share/doc/wwwoffle/README.PWD share/doc/wwwoffle/README.htdig share/doc/wwwoffle/README.win32 +share/doc/wwwoffle/README.lang share/doc/wwwoffle/UPGRADE @dirrm share/doc/wwwoffle @exec @GTAR@ xzCf / %D/libdata/wwwoffle-spool.tar.gz -@unexec rm -rf /var/wwwoffle +@unexec cd /var/wwwoffle && rm -rf html lasttime outgoing prevtime* temp +@unexec rmdir /var/wwwoffle/* 2>/dev/null && rmdir /var/wwwoffle ; : +@unexec if [ -d /var/wwwoffle ]; then echo "If you won't use the WWWOFFLE package anymore, remove the cache manually by"; echo ' rm -rf /var/wwwoffle'; fi |