git: c0c38ad61f55 - main - www/publicfile: Remove expired port
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 04 May 2025 12:06:26 UTC
The branch main has been updated by rene: URL: https://cgit.FreeBSD.org/ports/commit/?id=c0c38ad61f55c5006a0588e6ce4ee875300f5c57 commit c0c38ad61f55c5006a0588e6ce4ee875300f5c57 Author: Rene Ladan <rene@FreeBSD.org> AuthorDate: 2025-05-04 12:06:22 +0000 Commit: Rene Ladan <rene@FreeBSD.org> CommitDate: 2025-05-04 12:06:22 +0000 www/publicfile: Remove expired port 2025-04-30 www/publicfile: Unmaintained for years upstream and in tree, consider using www/darkhttpd , www/miniserve and/or ftp/tnftpd , ftp/unftp --- MOVED | 1 + www/Makefile | 1 - www/publicfile/Makefile | 93 --- www/publicfile/distinfo | 2 - www/publicfile/files/patch-Makefile | 49 -- www/publicfile/files/patch-auto_home_stage.h | 9 - www/publicfile/files/patch-error.h | 11 - www/publicfile/files/patch-fetch.c | 20 - www/publicfile/files/patch-hier.c | 14 - .../files/publicfile-0.52-commonlog-2.patch | 463 --------------- www/publicfile/files/publicfile-0.52-filetype-diff | 34 -- .../files/publicfile-0.52_basicauth.patch | 629 --------------------- www/publicfile/files/publicfile.sslserver | 36 -- www/publicfile/files/redirect-slash-patch | 217 ------- www/publicfile/pkg-descr | 20 - www/publicfile/pkg-plist | 4 - 16 files changed, 1 insertion(+), 1602 deletions(-) diff --git a/MOVED b/MOVED index 8a345611cfbf..f845143d60cf 100644 --- a/MOVED +++ b/MOVED @@ -4393,3 +4393,4 @@ devel/ccdoc||2025-05-04|Has expired: Obsolete utility www/moodle43||2025-05-04|Has expired: EOLed upstream net/libtnl||2025-05-04|Has expired: Unmaintained upstream and no consumers in the ports tree www/moodle41||2025-05-04|Has expired: Outdated version +www/publicfile||2025-05-04|Has expired: Unmaintained for years upstream and in tree, consider using www/darkhttpd , www/miniserve and/or ftp/tnftpd , ftp/unftp diff --git a/www/Makefile b/www/Makefile index 61c605a9e893..b8e680c02106 100644 --- a/www/Makefile +++ b/www/Makefile @@ -1456,7 +1456,6 @@ SUBDIR += privoxy SUBDIR += protovis SUBDIR += proxygen - SUBDIR += publicfile SUBDIR += punbb SUBDIR += py-Pituophis SUBDIR += py-Tenjin diff --git a/www/publicfile/Makefile b/www/publicfile/Makefile deleted file mode 100644 index fdc0cb24d936..000000000000 --- a/www/publicfile/Makefile +++ /dev/null @@ -1,93 +0,0 @@ -PORTNAME= publicfile -PORTVERSION= 0.52 -PORTREVISION= 3 -CATEGORIES= www ftp -MASTER_SITES= http://cr.yp.to/publicfile/ - -MAINTAINER= ports@FreeBSD.org -COMMENT= Secure, read-only, anonymous HTTP/FTP server -WWW= https://cr.yp.to/publicfile.html - -# Converted from LEGAL_TEXT -LICENSE= djb -LICENSE_NAME= djb -LICENSE_TEXT= No license -- see http://cr.yp.to/softwarelaw.html -LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept - -DEPRECATED= Unmaintained for years upstream and in tree, consider using www/darkhttpd , www/miniserve and/or ftp/tnftpd , ftp/unftp -EXPIRATION_DATE=2025-04-30 - -RUN_DEPENDS= setuidgid:sysutils/daemontools \ - tcpserver:sysutils/ucspi-tcp - -OPTIONS_DEFINE= BASICAUTH COMMONLOG REDIRECT_SLASH ENV_FILETYPES SSL -BASICAUTH_DESC= basic HTTP authentication support -COMMONLOG_DESC= support for Apache common log format -REDIRECT_SLASH_DESC= do not require trailing slash on directories -ENV_FILETYPES_DESC= get mime types from the environment -SSL_DESC= provide SSL support through ucspi-ssl - -CONFLICTS= xshttpd-3* - -.include <bsd.port.options.mk> - -.if ${PORT_OPTIONS:MBASICAUTH} && ${PORT_OPTIONS:MCOMMONLOG} -BROKEN= common log and auth patches are currently in conflict -.endif - -.if ${PORT_OPTIONS:MBASICAUTH} && ${PORT_OPTIONS:MREDIRECT_SLASH} -BROKEN= redirect slash and auth patches are currently in conflict -.endif - -.if ${PORT_OPTIONS:MREDIRECT_SLASH} -pre-configure:: - @${PATCH} -d ${PATCH_WRKSRC} ${PATCH_ARGS} < ${PATCHDIR}/redirect-slash-patch -.endif - -.if ${PORT_OPTIONS:MENV_FILETYPES} -pre-configure:: - @${PATCH} -d ${PATCH_WRKSRC} ${PATCH_ARGS} < ${PATCHDIR}/publicfile-0.52-filetype-diff -.endif - -.if ${PORT_OPTIONS:MSSL} -pre-configure:: - @${PATCH} -d ${PATCH_WRKSRC} ${PATCH_ARGS} < ${PATCHDIR}/publicfile.sslserver -RUN_DEPENDS+= sslserver:sysutils/ucspi-ssl -.endif - -.if ${PORT_OPTIONS:MBASICAUTH} -pre-configure:: - @${PATCH} -d ${PATCH_WRKSRC} ${PATCH_ARGS} -p1 < \ - ${PATCHDIR}/publicfile-0.52_basicauth.patch -PATCH_DEPENDS+= ${NONEXISTENT}:databases/cdb:extract -PLIST_SUB+= BASICAUTH="" -.else -PLIST_SUB+= BASICAUTH="@comment " -.endif - -.if ${PORT_OPTIONS:MCOMMONLOG} -pre-configure:: - @${PATCH} -d ${PATCH_WRKSRC} ${PATCH_ARGS} -p1 < \ - ${PATCHDIR}/publicfile-0.52-commonlog-2.patch -.endif - -ALL_TARGET= it -INSTALL_TARGET= setup check - -post-extract: -.if ${PORT_OPTIONS:MBASICAUTH} - @${LN} -s $$(${MAKE} -C ${PORTSDIR}/databases/cdb -V WRKSRC) ${WRKSRC}/cdb -.endif - -post-patch: - @${ECHO_CMD} "${CC} ${CFLAGS}" > ${WRKSRC}/conf-cc - @${ECHO_CMD} "${CC} -s" > ${WRKSRC}/conf-ld - @${ECHO_CMD} "${PREFIX}" > ${WRKSRC}/conf-home - @${ECHO_CMD} "${STAGEDIR}${PREFIX}" > ${WRKSRC}/conf-stage -.if ${PORT_OPTIONS:MBASICAUTH} - @${ECHO_CMD} "${CC} ${CFLAGS}" > ${WRKSRC}/cdb/conf-cc - @${ECHO_CMD} "${CC} -s" > ${WRKSRC}/cdb/conf-ld - @${ECHO_CMD} "${PREFIX}" > ${WRKSRC}/cdb/conf-home -.endif - -.include <bsd.port.mk> diff --git a/www/publicfile/distinfo b/www/publicfile/distinfo deleted file mode 100644 index 061006887c05..000000000000 --- a/www/publicfile/distinfo +++ /dev/null @@ -1,2 +0,0 @@ -SHA256 (publicfile-0.52.tar.gz) = 3f9fcf737bfe48910812cc357a31bf1f2e3da2490dbd175ce535830f251c08ef -SIZE (publicfile-0.52.tar.gz) = 34892 diff --git a/www/publicfile/files/patch-Makefile b/www/publicfile/files/patch-Makefile deleted file mode 100644 index 35ce26a1214b..000000000000 --- a/www/publicfile/files/patch-Makefile +++ /dev/null @@ -1,49 +0,0 @@ ---- Makefile.orig 1999-11-09 07:23:46 UTC -+++ Makefile -@@ -32,6 +32,14 @@ compile auto_home.c - compile auto_home.c - ./compile auto_home.c - -+auto_home_stage.c: \ -+auto-str conf-stage -+ ./auto-str auto_home `head -1 conf-stage` > auto_home_stage.c -+ -+auto_home_stage.o: \ -+compile auto_home_stage.c -+ ./compile auto_home_stage.c -+ - byte_chr.o: \ - compile byte_chr.c byte.h - ./compile byte_chr.c -@@ -231,7 +239,7 @@ hier.o: \ - ./choose clr tryshsgr hasshsgr.h1 hasshsgr.h2 > hasshsgr.h - - hier.o: \ --compile hier.c auto_home.h -+compile hier.c auto_home_stage.h - ./compile hier.c - - httpd: \ -@@ -257,9 +265,9 @@ install: \ - ./compile httpdate.c - - install: \ --load install.o hier.o auto_home.o strerr.a substdio.a open.a error.a \ -+load install.o hier.o auto_home_stage.o strerr.a substdio.a open.a error.a \ - str.a -- ./load install hier.o auto_home.o strerr.a substdio.a \ -+ ./load install hier.o auto_home_stage.o strerr.a substdio.a \ - open.a error.a str.a - - install.o: \ -@@ -268,8 +276,8 @@ instcheck: \ - ./compile install.c - - instcheck: \ --load instcheck.o hier.o auto_home.o strerr.a substdio.a error.a str.a -- ./load instcheck hier.o auto_home.o strerr.a substdio.a \ -+load instcheck.o hier.o auto_home_stage.o strerr.a substdio.a error.a str.a -+ ./load instcheck hier.o auto_home_stage.o strerr.a substdio.a \ - error.a str.a - - instcheck.o: \ diff --git a/www/publicfile/files/patch-auto_home_stage.h b/www/publicfile/files/patch-auto_home_stage.h deleted file mode 100644 index 35880e55a9a9..000000000000 --- a/www/publicfile/files/patch-auto_home_stage.h +++ /dev/null @@ -1,9 +0,0 @@ ---- auto_home_stage.h.orig 2024-10-25 11:20:18 UTC -+++ auto_home_stage.h -@@ -0,0 +1,6 @@ -+#ifndef AUTO_HOME_STAGE_H_ -+#define AUTO_HOME_STAGE_H_ -+ -+extern char auto_home[]; -+ -+#endif diff --git a/www/publicfile/files/patch-error.h b/www/publicfile/files/patch-error.h deleted file mode 100644 index e466f6122d08..000000000000 --- a/www/publicfile/files/patch-error.h +++ /dev/null @@ -1,11 +0,0 @@ ---- error.h.orig 2024-10-25 11:21:26 UTC -+++ error.h -@@ -1,7 +1,7 @@ - #ifndef ERROR_H - #define ERROR_H - --extern int errno; -+#include <errno.h> - - extern int error_intr; - extern int error_nomem; diff --git a/www/publicfile/files/patch-fetch.c b/www/publicfile/files/patch-fetch.c deleted file mode 100644 index be6f256cba76..000000000000 --- a/www/publicfile/files/patch-fetch.c +++ /dev/null @@ -1,20 +0,0 @@ ---- fetch.c.orig 1999-11-09 07:23:46 UTC -+++ fetch.c -@@ -82,7 +82,7 @@ static void list(char *fn,int flaglong) - substdio_puts(&ss,"\r\n"); - } - --static int doit(char *fn,int fddata,int fdfile,int how) -+static void doit(char *fn,int fddata,int fdfile,int how) - { - DIR *dir; - direntry *d; -@@ -122,7 +122,7 @@ static int doit(char *fn,int fddata,int fdfile,int how - for (;;) { - r = read(fdfile,inbuf,sizeof inbuf); - if (r == -1) { -- if (errno = error_intr) continue; -+ if (errno == error_intr) continue; - _exit(23); - } - if (r == 0) diff --git a/www/publicfile/files/patch-hier.c b/www/publicfile/files/patch-hier.c deleted file mode 100644 index be93922dd715..000000000000 --- a/www/publicfile/files/patch-hier.c +++ /dev/null @@ -1,14 +0,0 @@ ---- hier.c.orig 1999-11-09 07:23:46 UTC -+++ hier.c -@@ -2,9 +2,9 @@ void hier() - - void hier() - { -- h(auto_home,-1,-1,02755); -+ h(auto_home,-1,-1,0755); - -- d(auto_home,"bin",-1,-1,02755); -+ d(auto_home,"bin",-1,-1,0755); - - c(auto_home,"bin","configure",-1,-1,0755); - c(auto_home,"bin","httpd",-1,-1,0755); diff --git a/www/publicfile/files/publicfile-0.52-commonlog-2.patch b/www/publicfile/files/publicfile-0.52-commonlog-2.patch deleted file mode 100644 index ed14642b22e7..000000000000 --- a/www/publicfile/files/publicfile-0.52-commonlog-2.patch +++ /dev/null @@ -1,463 +0,0 @@ -diff -rNC3 publicfile-0.52.orig/Makefile publicfile-0.52/Makefile -*** publicfile-0.52.orig/Makefile Tue Nov 9 08:23:46 1999 ---- publicfile-0.52/Makefile Fri Nov 9 10:09:45 2001 -*************** -*** 450,460 **** - stralloc.a: \ - makelib stralloc_cat.o stralloc_catb.o stralloc_cats.o \ - stralloc_copy.o stralloc_eady.o stralloc_opyb.o stralloc_opys.o \ -! stralloc_pend.o stralloc_num.o - ./makelib stralloc.a stralloc_cat.o stralloc_catb.o \ - stralloc_cats.o stralloc_copy.o stralloc_eady.o \ - stralloc_opyb.o stralloc_opys.o stralloc_pend.o \ -! stralloc_num.o - - stralloc_cat.o: \ - compile stralloc_cat.c byte.h stralloc.h gen_alloc.h ---- 450,460 ---- - stralloc.a: \ - makelib stralloc_cat.o stralloc_catb.o stralloc_cats.o \ - stralloc_copy.o stralloc_eady.o stralloc_opyb.o stralloc_opys.o \ -! stralloc_pend.o stralloc_num.o stralloc_opytrim.o - ./makelib stralloc.a stralloc_cat.o stralloc_catb.o \ - stralloc_cats.o stralloc_copy.o stralloc_eady.o \ - stralloc_opyb.o stralloc_opys.o stralloc_pend.o \ -! stralloc_num.o stralloc_opytrim.o - - stralloc_cat.o: \ - compile stralloc_cat.c byte.h stralloc.h gen_alloc.h -*************** -*** 484,489 **** ---- 484,493 ---- - stralloc_opyb.o: \ - compile stralloc_opyb.c stralloc.h gen_alloc.h byte.h - ./compile stralloc_opyb.c -+ -+ stralloc_opytrim.o: \ -+ compile stralloc_opytrim.c stralloc.h -+ ./compile stralloc_opytrim.c - - stralloc_opys.o: \ - compile stralloc_opys.c byte.h str.h stralloc.h gen_alloc.h -diff -rNC3 publicfile-0.52.orig/README.log_combined publicfile-0.52/README.log_combined -*** publicfile-0.52.orig/README.log_combined Thu Jan 1 01:00:00 1970 ---- publicfile-0.52/README.log_combined Fri Nov 9 10:09:45 2001 -*************** -*** 0 **** ---- 1,36 ---- -+ This version of publicfile has been patched to write *additional* log -+ information to STDERR. This additional information conforms to Apache's -+ and Netscape's "common" or "combined" log formats, i. e. a line may look -+ like this (common log format): -+ -+ 127.0.0.1 - - [23/Oct/2001:14:04:56 +0200] "HEAD /~conrad/hello_world_gen.swf HTTP/1.0" 200 0 -+ -+ or like this (combined log format): -+ -+ 127.0.0.1 - - [23/Oct/2001:14:04:56 +0200] "HEAD /~conrad/hello_world_gen.swf HTTP/1.0" 200 0 "http://localhost/~conrad/hello_world.html" "Mozilla 4" -+ -+ The meaning of the (space-separated) fields is as follows: -+ -+ 1. Client IP-address -+ 2. Remote logname (from ident (RFC-...) lookup - always "-" in publicfile) -+ 3. Authenticated username (from Basic-Auth - always "-" in publicfile) -+ 4. Human-readable timestamp enclosed in [] -+ 5. The request line enclosed in "" -+ 6. HTTP status code -+ 7. Number of bytes sent excluding HTTP headers -+ 8. Referrer information sent by the browser -+ 9. User-Agent information sent by the browser -+ -+ These log lines can easily be distinguished from other log lines using the -+ second field: this will always be "-" for common and combined log lines, -+ and "read" or "dir" for publicfile standard log lines (see -+ http://cr.yp.to/publicfile/log.html). The script "splitPublicfileLog.pl" -+ may serve as an example how to split the log into interesting parts. -+ -+ The logformat to be used can be selected via environment variables: -+ -+ - HTTPD_LOG_COMMON selects common log format -+ - HTTPD_LOG_COMBINED selects combined log format -+ -+ The latter takes precedence over the former. -+ -diff -rNC3 publicfile-0.52.orig/httpd.c publicfile-0.52/httpd.c -*** publicfile-0.52.orig/httpd.c Tue Nov 9 08:23:46 1999 ---- publicfile-0.52/httpd.c Fri Nov 9 10:10:51 2001 -*************** -*** 15,20 **** ---- 15,102 ---- - #include "substdio.h" - #include "error.h" - #include "getln.h" -+ #include "caltime.h" -+ #include "subfd.h" -+ #include "env.h" -+ -+ char logformat = 0; -+ char *remoteip; -+ char *months[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", -+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; -+ stralloc referer = {0}; -+ stralloc agent = {0}; -+ -+ char strnum[FMT_ULONG]; -+ stralloc method = {0}; -+ stralloc url = {0}; -+ stralloc protocol = {0}; -+ stralloc host = {0}; -+ -+ void log(char *code, unsigned long length) { -+ struct caltime ct; -+ int dummy1, dummy2; -+ struct tai now; -+ -+ if (!logformat) return; -+ -+ substdio_puts(subfderr,remoteip); -+ substdio_puts(subfderr," - - ["); -+ tai_now(&now); -+ caltime_utc(&ct, &now, &dummy1, &dummy2); -+ if (ct.date.day < 10) -+ substdio_puts(subfderr,"0"); -+ dummy1 = fmt_ulong(strnum,ct.date.day); -+ substdio_put(subfderr,strnum,dummy1); -+ substdio_puts(subfderr,"/"); -+ if (ct.date.month > 0 && ct.date.month < 13) -+ substdio_puts(subfderr,months[ct.date.month-1]); -+ substdio_puts(subfderr,"/"); -+ dummy1 = fmt_ulong(strnum,ct.date.year); -+ substdio_put(subfderr,strnum,dummy1); -+ substdio_puts(subfderr,":"); -+ if (ct.hour < 10) -+ substdio_puts(subfderr,"0"); -+ dummy1 = fmt_ulong(strnum,ct.hour); -+ substdio_put(subfderr,strnum,dummy1); -+ substdio_puts(subfderr,":"); -+ if (ct.minute < 10) -+ substdio_puts(subfderr,"0"); -+ dummy1 = fmt_ulong(strnum,ct.minute); -+ substdio_put(subfderr,strnum,dummy1); -+ substdio_puts(subfderr,":"); -+ if (ct.second < 10) -+ substdio_puts(subfderr,"0"); -+ dummy1 = fmt_ulong(strnum,ct.second); -+ substdio_put(subfderr,strnum,dummy1); -+ substdio_puts(subfderr," +0000] \""); -+ substdio_put(subfderr,method.s,method.len - 1); /* len includes \0 */ -+ substdio_puts(subfderr," "); -+ substdio_put(subfderr,url.s,url.len); -+ substdio_puts(subfderr," "); -+ substdio_put(subfderr,protocol.s,protocol.len > 0 ? protocol.len - 1 : 0); /* len includes \0 */ -+ substdio_puts(subfderr,"\" "); -+ substdio_put(subfderr,code,str_len(code) < 3 ? str_len(code) : 3); -+ substdio_puts(subfderr," "); -+ if (length > 0) { -+ dummy1 = fmt_ulong(strnum,length); -+ substdio_put(subfderr,strnum,dummy1); -+ } else { -+ substdio_puts(subfderr,"-"); -+ } -+ -+ if (logformat > 1) { -+ substdio_puts(subfderr," \""); -+ substdio_put(subfderr,referer.s,referer.len); -+ substdio_puts(subfderr,"\" \""); -+ substdio_put(subfderr,agent.s,agent.len); -+ substdio_puts(subfderr,"\""); -+ } -+ -+ substdio_puts(subfderr," \""); -+ substdio_put(subfderr,host.s,host.len); -+ substdio_puts(subfderr,"\"\n"); -+ substdio_flush(subfderr); -+ } - - int safewrite(int fd,char *buf,int len) - { -*************** -*** 42,54 **** - substdio_flush(&out); - } - -- char strnum[FMT_ULONG]; -- -- stralloc protocol = {0}; - int protocolnum = 0; -- stralloc method = {0}; -- stralloc url = {0}; -- stralloc host = {0}; - stralloc path = {0}; - stralloc ims = {0}; - int flagbody = 1; ---- 124,130 ---- -*************** -*** 93,98 **** ---- 169,175 ---- - out_puts("</body></html>\r\n"); - } - out_flush(); -+ log(code, str_len(message) + 28); - if (protocolnum >= 2) { - shutdown(1,1); - sleep(1); /* XXX */ -*************** -*** 105,108 **** ---- 182,186 ---- - - void get(void) - { -+ char *code; - unsigned long length; -*************** -*** 133,143 **** - tai_now(&now); - if (!httpdate(&mtimestr,&mtime)) _exit(21); - if ((ims.len < mtimestr.len) || byte_diff(mtimestr.s,mtimestr.len,ims.s)) -! header("200 ","OK"); - else { -! header("304 ","OK"); - flagbody = 0; - } - if (tai_less(&mtime,&now)) { - tai_sub(&mtimeage,&now,&mtime); - if (tai_approx(&mtimeage) >= 60.0) { ---- 211,222 ---- - tai_now(&now); - if (!httpdate(&mtimestr,&mtime)) _exit(21); - if ((ims.len < mtimestr.len) || byte_diff(mtimestr.s,mtimestr.len,ims.s)) -! code = "200 "; - else { -! code = "304 "; - flagbody = 0; - } -+ header(code,"OK"); - if (tai_less(&mtime,&now)) { - tai_sub(&mtimeage,&now,&mtime); - if (tai_approx(&mtimeage) >= 60.0) { -*************** -*** 166,171 **** ---- 245,253 ---- - if (r == 0) break; - out_put(filebuf,r); - } -+ else -+ length = 0; -+ log(code,length); - out_flush(); - _exit(0); - } -*************** -*** 180,185 **** ---- 262,270 ---- - out_put(filebuf,r); - out_puts("\r\n"); - } -+ else -+ length = 0; -+ log(code,length); - - close(fd); - } -*************** -*** 216,221 **** ---- 301,314 ---- - - sig_pipeignore(); - -+ if (env_get("HTTPD_LOG_COMMON")) -+ logformat = 1; -+ if (env_get("HTTPD_LOG_COMBINED")) -+ logformat = 2; -+ remoteip = env_get("TCPREMOTEIP"); -+ if (!remoteip) -+ remoteip = "0"; -+ - for (;;) { - readline(); - -*************** -*** 227,232 **** ---- 320,327 ---- - if (!stralloc_copys(&path,"")) _exit(21); - if (!stralloc_copys(&protocol,"")) _exit(21); - if (!stralloc_copys(&ims,"")) _exit(21); -+ if (!stralloc_copys(&referer,"")) _exit(21); -+ if (!stralloc_copys(&agent,"")) _exit(21); - protocolnum = 2; - - spaces = 0; -*************** -*** 294,299 **** ---- 389,398 ---- - barf("412 ","I do not accept If-None-Match"); - if (case_startb(field.s,field.len,"if-unmodified-since:")) - barf("412 ","I do not accept If-Unmodified-Since"); -+ if (case_startb(field.s,field.len,"referer:")) -+ if (!stralloc_copytrim(&referer,field.s + 8,field.len - 8)) _exit(21); -+ if (case_startb(field.s,field.len,"user-agent:")) -+ if (!stralloc_copytrim(&agent,field.s + 11,field.len - 11)) _exit(21); - if (case_startb(field.s,field.len,"host:")) - if (!host.len) - for (i = 5;i < field.len;++i) -diff -rNC3 publicfile-0.52.orig/splitPublicfileLog.pl publicfile-0.52/splitPublicfileLog.pl -*** publicfile-0.52.orig/splitPublicfileLog.pl Thu Jan 1 01:00:00 1970 ---- publicfile-0.52/splitPublicfileLog.pl Fri Nov 9 10:09:45 2001 -*************** -*** 0 **** ---- 1,119 ---- -+ #!/usr/bin/perl -w -+ -+ # This script will read lines from stdin. All lines starting with -+ # "a.b.c.d - " (for an IP-number a.b.c.d) will be written to the -+ # "access logfile" given as the first argument. Anything else will be -+ # prepended with a timestamp and -+ # written to the "error logfile" given as the second argument. -+ # Note that the messages usually are not really *error* messages, but -+ # simply the standard publicfile output. -+ -+ use strict; -+ use Symbol; -+ -+ if ($#ARGV < 0 || $#ARGV > 3) { -+ &usage(); -+ } -+ -+ local $main::logdir; -+ local $main::accessfile; -+ local $main::errorfile; -+ local $main::multilog; -+ local %main::handles = (); -+ -+ if ($ARGV[0] eq "-m") { -+ $main::multilog = 1; -+ if ($#ARGV != 3) { &usage(); } -+ $main::logdir = $ARGV[1]."/"; -+ $main::accessfile = $main::logdir.$ARGV[2]; -+ $main::errorfile = $main::logdir.$ARGV[3]; -+ } else { -+ $main::multilog = 0; -+ if ($#ARGV != 1) { &usage(); } -+ $main::accessfile = $ARGV[0]; -+ $main::errorfile = $ARGV[1]; -+ } -+ -+ #open(ACCESS, ">>".$ARGV[0]) || die("Can't open access logfile!"); -+ #open(ERROR, ">>".$ARGV[1]) || die("Can't open error logfile!"); -+ $SIG{PIPE} = \&closeAndExit; -+ $SIG{TERM} = \&closeAndExit; -+ $SIG{QUIT} = \&closeAndExit; -+ $SIG{INT} = \&closeAndExit; -+ $SIG{HUP} = \&closeAll; -+ -+ while($_ = <STDIN>) { -+ if (/^\d+\.\d+\.\d+\.\d+ - /) { -+ my $host = ""; -+ if ($main::multilog && / \"([^\"\/]*)\"[\r\n]*$/) { -+ $_ = $`."\n"; -+ $host = $1; -+ } -+ my $fh = &getHandle($host); -+ print $fh $_; -+ } else { -+ my $fh = &getHandle($main::errorfile); -+ print $fh time()." $_"; -+ } -+ } -+ -+ closeAndExit("End of input"); -+ -+ sub closeAll { -+ foreach my $key (keys %main::handles) { -+ my $fh = $main::handles{$key}; -+ close $fh; -+ delete $main::handles{$key}; -+ } -+ } -+ -+ sub closeAndExit { -+ my $reason = shift; -+ my $now = time(); -+ -+ my $fh = &getHandle($main::errorfile); -+ print $fh "$now $reason received\n"; -+ print STDERR "$now $reason received\n"; -+ &closeAll(); -+ exit 0; -+ } -+ -+ sub getHandle { -+ my $key = shift; -+ my $res = 0; -+ -+ if (defined($main::handles{$key})) { -+ return $main::handles{$key}; -+ } -+ -+ my $fh = Symbol::gensym(); -+ if ($key eq $main::errorfile) { -+ open($fh, ">>".$main::errorfile) || die("Can't open error logfile!"); -+ } else { -+ if ($main::multilog) { -+ my $fn = $main::logdir.$key; -+ if (-f $fn && -w $fn) { -+ $res = open($fh, ">>$fn"); -+ } -+ } -+ if (!$res) { -+ open($fh, ">>".$main::accessfile) || die("Can't open error logfile!"); -+ } -+ } -+ -+ $main::handles{$key} = $fh; -+ return $fh; -+ } -+ -+ sub usage { -+ print STDERR "Usage: $0 <access-path> <error-path>\n"; -+ print STDERR " or: $0 -m <logdir> <access-file> <error-file>\n"; -+ print STDERR "The first form will separate publicfile standard messages from \"common\" log\n"; -+ print STDERR "lines. The second form will write \"common\" lines to <logdir>/<hostname>\n"; -+ print STDERR "where <hostname> is the host given in the request. The file <logdir>/<hostname>\n"; -+ print STDERR "must exist before it will be used. Anything for which no suitable logfile can\n"; -+ print STDERR "be found will be logged to <logdir>/<access-path>.\n"; -+ -+ exit 1; -+ } -+ -diff -rNC3 publicfile-0.52.orig/stralloc.h publicfile-0.52/stralloc.h -*** publicfile-0.52.orig/stralloc.h Tue Nov 9 08:23:46 1999 ---- publicfile-0.52/stralloc.h Fri Nov 9 10:09:45 2001 -*************** -*** 12,17 **** ---- 12,18 ---- - extern int stralloc_copys(); - extern int stralloc_cats(); - extern int stralloc_copyb(); -+ extern int stralloc_copytrim(); - extern int stralloc_catb(); - extern int stralloc_append(); /* beware: this takes a pointer to 1 char */ - extern int stralloc_starts(); -diff -rNC3 publicfile-0.52.orig/stralloc_opytrim.c publicfile-0.52/stralloc_opytrim.c -*** publicfile-0.52.orig/stralloc_opytrim.c Thu Jan 1 01:00:00 1970 ---- publicfile-0.52/stralloc_opytrim.c Fri Nov 9 10:09:45 2001 -*************** -*** 0 **** ---- 1,17 ---- -+ #include "stralloc.h" -+ -+ int stralloc_copytrim(sa,s,n) -+ stralloc *sa; -+ char *s; -+ unsigned int n; -+ { -+ while (n > 0 && -+ (s[n] == ' ' || s[n] == '\t' || s[n] == '\n' || s[n] == '\r')) n--; -+ while (n > 0 && -+ (s[0] == ' ' || s[0] == '\t' || s[0] == '\n' || s[0] == '\r')) { -+ n--; -+ s++; -+ } -+ -+ return stralloc_copyb(sa,s,n); -+ } diff --git a/www/publicfile/files/publicfile-0.52-filetype-diff b/www/publicfile/files/publicfile-0.52-filetype-diff deleted file mode 100644 index 3c963feca229..000000000000 --- a/www/publicfile/files/publicfile-0.52-filetype-diff +++ /dev/null @@ -1,34 +0,0 @@ ---- filetype.c.old Mon Dec 6 10:43:36 1999 -+++ filetype.c Mon Dec 6 10:50:36 1999 -@@ -1,5 +1,6 @@ - #include "filetype.h" - #include "str.h" -+#include "env.h" - - void filetype(char *fn,stralloc *contenttype) - { -@@ -22,7 +23,7 @@ - if (!stralloc_append(contenttype,&ch)) _exit(21); - } - else { -- result = "text/plain"; -+ result = 0; - if (str_equal(x,".html")) result = "text/html"; - else if (str_equal(x,".gz")) result = "application/x-gzip"; - else if (str_equal(x,".dvi")) result = "application/x-dvi"; -@@ -32,6 +33,15 @@ - else if (str_equal(x,".jpeg")) result = "image/jpeg"; - else if (str_equal(x,".png")) result = "image/png"; - else if (str_equal(x,".mpeg")) result = "video/mpeg"; -+ if (!result) { -+ stralloc envname = {0}; -+ if (!stralloc_copys(&envname,"CT_")) _exit(21); -+ if (!stralloc_cats(&envname,x+1)) _exit(21); -+ if (!stralloc_0(&envname)) _exit(21); -+ result=env_get(envname.s); -+ alloc_free(envname.s); /* is this the right function */ -+ } -+ if (!result) result="text/plain"; - - if (!stralloc_cats(contenttype,result)) _exit(21); - } diff --git a/www/publicfile/files/publicfile-0.52_basicauth.patch b/www/publicfile/files/publicfile-0.52_basicauth.patch deleted file mode 100644 index 65bcc3a425c6..000000000000 --- a/www/publicfile/files/publicfile-0.52_basicauth.patch +++ /dev/null @@ -1,629 +0,0 @@ -diff -N -u -r publicfile-0.52.orig/Makefile publicfile-0.52/Makefile ---- publicfile-0.52.orig/Makefile Mon Nov 8 23:23:46 1999 -+++ publicfile-0.52/Makefile Wed Aug 29 20:27:09 2001 -@@ -234,21 +234,44 @@ - compile hier.c auto_home.h - ./compile hier.c - -+htrules: \ -+load htrules.o base64.o -+ ./load htrules cdb.a base64.o byte.a getln.a stralloc.a alloc.a \ -+ substdio.a str.a buffer.a unix.a -+ -+htrules.o: \ -+compile htrules.c strerr.h stralloc.h gen_alloc.h getln.h buffer.h \ -+stralloc.h buffer.h exit.h fmt.h byte.h cdb_make.h buffer.h uint32.h \ -+base64.h -+ ./compile htrules.c -+ -+base64.o: \ -+compile base64.c base64.h -+ ./compile base64.c -+ - httpd: \ - load httpd.o main.o pathdecode.o file.o filetype.o httpdate.o \ - percent.o prot.o timeoutread.o timeoutwrite.o libtai.a case.a getln.a \ - stralloc.a alloc.a substdio.a error.a open.a sig.a env.a str.a fs.a \ --socket.lib -+socket.lib readclose.o openreadclose.o - ./load httpd main.o pathdecode.o file.o filetype.o \ - httpdate.o percent.o prot.o timeoutread.o timeoutwrite.o \ - libtai.a case.a getln.a stralloc.a alloc.a substdio.a \ -- error.a open.a sig.a env.a str.a fs.a `cat socket.lib` -+ error.a open.a sig.a env.a str.a fs.a cdb.a byte.a seek_set.o \ -+ readclose.o openreadclose.o `cat socket.lib` -+ -+.cdb: -+ (cd cdb && \ -+ ${MAKE} && \ -+ cp -vp cdb_make.h buffer.h cdb.h uint32.h cdb.a byte.a seek_set.o \ -+ cdb_make.o error.c buffer.a unix.a ${PWD}/ && touch ${PWD}/.cdb) -+cdb buffer.h cdb_make.h cdb.h uint32.h cdb.a byte.a seek_set.o cdb_make.o error.c buffer.a unix.a: .cdb - - httpd.o: \ - compile httpd.c pathdecode.h stralloc.h gen_alloc.h file.h tai.h \ - uint64.h filetype.h stralloc.h percent.h stralloc.h stralloc.h sig.h \ - exit.h fmt.h case.h str.h tai.h httpdate.h stralloc.h tai.h \ --timeoutread.h timeoutwrite.h substdio.h error.h getln.h -+timeoutread.h timeoutwrite.h substdio.h error.h getln.h byte.h cdb.h - ./compile httpd.c - - httpdate.o: \ -@@ -358,6 +381,11 @@ - compile open_trunc.c open.h - ./compile open_trunc.c - -+openreadclose.o: \ -+compile openreadclose.c error.h open.h readclose.h stralloc.h \ -+gen_alloc.h openreadclose.h stralloc.h -+ ./compile openreadclose.c -+ - pathdecode.o: \ - compile pathdecode.c pathdecode.h stralloc.h gen_alloc.h - ./compile pathdecode.c -@@ -367,7 +395,7 @@ - ./compile percent.c - - prog: \ --configure httpd ftpd rts utime -+cdb configure httpd ftpd rts utime htrules - - prot.o: \ - compile prot.c hasshsgr.h prot.h ---- publicfile-0.52.orig/README.basicauth Wed Dec 31 16:00:00 1969 -+++ publicfile-0.52/README.basicauth Wed Aug 29 22:16:02 2001 -@@ -0,0 +1,100 @@ -+Here is a patch for publicfile to allow for Basic Auth. -+ -+Building Instructions: -+ -+Save this patch as publicfile-0.52.basicauth.patch -+Download publicfile-0.52 -+Download cdb-0.75 -+ -+gunzip publicfile-0.52.tar -+gunzip cdb-0.75.tar -+tar -xf publicfile-0.52.tar -+cd publicfile-0.52 -+tar -xf ../cdb-0.75.tar -+patch -p1 < publicfile-0.52.basicauth.patch -+ -+Follow normal installation instructions for publicfile beginning with -+'make setup check' -+ -+Usage Instructions: -+ -+Once this patch has been applied, httpd will check for a file -+called '.access' in the current directory of any requested -+file. e.g, if /public/file/0/path/to/file.html is requested, httpd -+will first check for /public/file/0/path/to/.access. -+ -+.access should have the format: -+ realm_id:realm_txt -+ -+realm_id is used as documented below. realm_txt is typically -+presented by the user's browser. .access must be readable by httpd -+and only protects a specific directory. Sub-directories are not -+protected unless they also contain a .access file. -+ -+An additional program will be installed in /usr/local/publicfile (or -+whatever conf-home is) called htrules. Use this like tcprules: -+ -+cd /public/file -+htrules access.cdb access.tmp < access -+ -+This may safely be run at any time. -+ -+access should have the format: -+ -+ # this is a comment. blank lines are allowed too. -+ # the next line authorizes a user to a specific realm_id -+ realm_id:username:password -+ # the next line authorizes host class. -+ realm_id:LOCALHOST -+ -+access.cdb must be readable by httpd. -+ -+realm_id corresponds to the realm_id in the .access file(s). -+ -+Each realm_id line specifies either a username:password combination -+or a host class. Note that the same username may have different -+passwords in different realm_id's. -+ -+A host is mapped into a host class via the environment -+variable HTTPCLIENT. This environment variable should be -+set in tcpserver's rules.cdb. -+ -+Here is an example: -+ -+ === /public/file/0/private1/.access === -+ realm1:Dr. Suess -+ -+ === /public/file/0/private2/.access === -+ realm2:Sesame Street -+ -+ === /public/file/access === -+ # realm1 are Dr Suess users/clients -+ realm1:john:catinthehat -+ realm1:mary:greeneggswithham -+ realm1:LOCALHOST -+ realm1:DR SUESS -+ # realm1 are Sesame Street users/clients -+ realm2:tom:bigbird -+ realm2:abi:cookiemonster -+ realm2:mary:earnie -+ realm2:LOCALHOST -+ realm2:SESAME STREET -+ -+ === /etc/rules === -+ 127.0.0.1:allow,HTTPCLIENT="LOCALHOST" -+ 10.0.0.:allow,HTTPCLIENT="DR SUESS" -+ 10.1.0.:allow,HTTPCLIENT="SESAME STREET" -+ :allow -+ -+The changes to the Makefile aren't very clean, but everything compiles -+correctly. -+ -+Thanks to Eric M. Johnston's for base64.{c,h} from YAQSAP -+(Yet Another qmail SMTP AUTH Patch) - -+http://qmail.goof.com/qmail-auth-20010105.tar.gz -+ -+This patch available at -+http://www.soffian.org/downloads/publicfile-0.52_basicauth.patch -+ -+Jay Soffian <jay@soffian.org> 29 Aug 2001 -+ ---- publicfile-0.52.orig/base64.c Wed Dec 31 16:00:00 1969 -+++ publicfile-0.52/base64.c Wed Aug 22 22:17:39 2001 -@@ -0,0 +1,90 @@ *** 752 LINES SKIPPED ***