Skip to content

Commit

Permalink
publicfile: bump PKGREVISION. Changes:
Browse files Browse the repository at this point in the history
- Remove inet6 option; simply depend on dual-stack ucspi-tcp6 (or
  v4-only original DJB ucspi-tcp, if that's already installed)
- Apply upstream patch to support https URLs under e.g. sslserver
- Add patch comments
  • Loading branch information
schmonz committed Nov 16, 2023
1 parent ce370d5 commit 7f11b2d
Show file tree
Hide file tree
Showing 18 changed files with 109 additions and 51 deletions.
10 changes: 4 additions & 6 deletions net/publicfile/Makefile
@@ -1,23 +1,21 @@
# $NetBSD: Makefile,v 1.19 2020/11/19 08:11:18 schmonz Exp $
#
# $NetBSD: Makefile,v 1.20 2023/11/16 22:55:37 schmonz Exp $

DISTNAME= publicfile-0.52
PKGREVISION= 2
PKGREVISION= 3
CATEGORIES= net
MASTER_SITES= http://cr.yp.to/publicfile/
MASTER_SITES= https://cr.yp.to/publicfile/

MAINTAINER= schmonz@NetBSD.org
HOMEPAGE= https://cr.yp.to/publicfile.html
COMMENT= Secure read-only HTTP and FTP servers
LICENSE= djb-nonlicense

DEPENDS+= daemontools-[0-9]*:../../sysutils/daemontools
DEPENDS+= {ucspi-tcp6-[0-9]*,ucspi-tcp-[0-9]*}:../../net/ucspi-tcp6

DJB_CONFIG_PREFIX= ${PREFIX}/publicfile

SUBST_CLASSES+= djberrno

.include "options.mk"

.include "../../mk/djbware.mk"
.include "../../mk/bsd.pkg.mk"
32 changes: 16 additions & 16 deletions net/publicfile/distinfo
@@ -1,20 +1,20 @@
$NetBSD: distinfo,v 1.7 2021/10/26 11:06:32 nia Exp $
$NetBSD: distinfo,v 1.8 2023/11/16 22:55:37 schmonz Exp $

BLAKE2s (publicfile-0.52.tar.gz) = 967b4df1ae39e3abeb2a788c56743bf08fda26e233fd36d9ffa5472608e26e90
SHA512 (publicfile-0.52.tar.gz) = f0de968d271b0631362d4175e25d2b0901bf125262cb4dcde8ba246eea0d0fcf54460e834413ac4a2bd93cd4009a1dedc4598a8e763e5a2b781b5ae7a26ff86e
Size (publicfile-0.52.tar.gz) = 34892 bytes
SHA1 (patch-Makefile) = e9933a7337b4fa6683fb6c11a6421bfa6e6962eb
SHA1 (patch-alloc.c) = 3a8491e1f15595cafba1406e22d282fdb1734365
SHA1 (patch-exit.h) = cff7aa714c2dcfa95f3663af12a3e26013a4d391
SHA1 (patch-fetch.c) = fc10297708df10817eff97927d1fc2f05acbaff0
SHA1 (patch-file.c) = 15a9db2b4225ccbe935a71a3515553b1f9731af8
SHA1 (patch-filetype.c) = 87e2fa25e92c41fa0ce84c8cd7549ba83f00f4b0
SHA1 (patch-ftpd.c) = 90755132891cf6b36a5e0a5c589b6c11857dfeec
SHA1 (patch-httpd.c) = 4fa3d55ea17b2a626109da2c84a60a6c5f9b8972
SHA1 (patch-leapsecs__read.c) = b956b8983d7a680b0349d9f99551a6480a1f664b
SHA1 (patch-main.c) = abe752e15212ee4f191de4e56256d7e137cfb184
SHA1 (patch-open.h) = 4605a65b282d013c71a02128df3c297a259cfa16
SHA1 (patch-prot.c) = 35c0fdce5b121f5b17b8cb4a288f4d43b8e8e197
SHA1 (patch-prot.h) = 6c47e387dbc9c9bc59f53a84e2112fadd6836118
SHA1 (patch-readwrite.h) = e6f17cddb9673ebb4a458c557215c28526712501
SHA1 (patch-utime.c) = cd4b3414200c190cec781d00cf36267e2a0b4208
SHA1 (patch-Makefile) = 23115b041f42a52f7f3430a35d416037ae19acea
SHA1 (patch-alloc.c) = 45457cb24fbce7eb13adf6add26050426aaf8e49
SHA1 (patch-exit.h) = cd6c0a1ae0f22fc2ef6ee3c491f27c8c820cef4d
SHA1 (patch-fetch.c) = ce1ff0bac3f2c01d042b77ff18c77b1c638c83d0
SHA1 (patch-file.c) = 65788b3fdb4b24c2c735bae866c6847be0e3e50f
SHA1 (patch-filetype.c) = 9f3120698b4c9b50bd23b5776b29cf87d6e98ee1
SHA1 (patch-ftpd.c) = 9b315c30b30c5d69a0bf0222b941948f18108eaf
SHA1 (patch-httpd.c) = c1824c80ab2b07f95d5b51038cd8883f0b3e0f66
SHA1 (patch-leapsecs__read.c) = 9e8337c1094dc828188496b263f35b19399b0533
SHA1 (patch-main.c) = 47802e9539325840bfad4fbe0c14e567c6338e71
SHA1 (patch-open.h) = 2bf8849bacbf82afd26aee565fc4a55ee62b76bf
SHA1 (patch-prot.c) = 9732b6d8b2ae0d316aa79b0e4da9d8251ec2f8a2
SHA1 (patch-prot.h) = 1f27c1a52feeba8f6ca30f3c440c54c0a60f68eb
SHA1 (patch-readwrite.h) = 0462c1f8cfc6447e2fe9693759ce319d79b1bb75
SHA1 (patch-utime.c) = 299d7e051ea73d2fe1150d69f8fa1e23670d5423
12 changes: 0 additions & 12 deletions net/publicfile/options.mk

This file was deleted.

4 changes: 3 additions & 1 deletion net/publicfile/patches/patch-Makefile
@@ -1,4 +1,6 @@
$NetBSD: patch-Makefile,v 1.1 2013/05/23 14:57:32 joerg Exp $
$NetBSD: patch-Makefile,v 1.2 2023/11/16 22:55:37 schmonz Exp $

Support DESTDIR.

--- Makefile.orig 1999-11-09 07:23:46.000000000 +0000
+++ Makefile
Expand Down
4 changes: 3 additions & 1 deletion net/publicfile/patches/patch-alloc.c
@@ -1,4 +1,6 @@
$NetBSD: patch-alloc.c,v 1.1 2013/05/23 14:57:32 joerg Exp $
$NetBSD: patch-alloc.c,v 1.2 2023/11/16 22:55:37 schmonz Exp $

Add missing include.

--- alloc.c.orig 1999-11-09 07:23:46.000000000 +0000
+++ alloc.c
Expand Down
4 changes: 3 additions & 1 deletion net/publicfile/patches/patch-exit.h
@@ -1,4 +1,6 @@
$NetBSD: patch-exit.h,v 1.1 2013/05/23 14:57:32 joerg Exp $
$NetBSD: patch-exit.h,v 1.2 2023/11/16 22:55:37 schmonz Exp $

Add missing includes.

--- exit.h.orig 1999-11-09 07:23:46.000000000 +0000
+++ exit.h
Expand Down
4 changes: 3 additions & 1 deletion net/publicfile/patches/patch-fetch.c
@@ -1,4 +1,6 @@
$NetBSD: patch-fetch.c,v 1.1 2013/05/23 14:57:32 joerg Exp $
$NetBSD: patch-fetch.c,v 1.2 2023/11/16 22:55:37 schmonz Exp $

Add missing includes.

--- fetch.c.orig 1999-11-09 07:23:46.000000000 +0000
+++ fetch.c
Expand Down
23 changes: 21 additions & 2 deletions net/publicfile/patches/patch-file.c
@@ -1,6 +1,12 @@
$NetBSD: patch-file.c,v 1.1 2013/05/23 14:57:32 joerg Exp $
$NetBSD: patch-file.c,v 1.2 2023/11/16 22:55:37 schmonz Exp $

--- file.c.orig 1999-11-09 07:23:46.000000000 +0000
Handle request URLs with an https scheme. Look for the client IP in
SSLREMOTEIP if TCPREMOTEIP is not set.
<http://www.superscript.com/patches/publicfile.sslserver>

Add missing includes.

--- file.c.orig 2023-11-16 22:52:07.122614429 +0000
+++ file.c
@@ -7,6 +7,8 @@
#include "str.h"
Expand All @@ -11,3 +17,16 @@

static void log(char *fn,char *result1,char *result2,int flagread)
{
@@ -15,7 +17,11 @@ static void log(char *fn,char *result1,c
char *x;

x = env_get("TCPREMOTEIP");
- if (!x) x = "0";
+ if (!x) {
+ x = env_get("SSLREMOTEIP");
+ if (!x)
+ x = "0";
+ }
substdio_puts(subfderr,x);
substdio_puts(subfderr,flagread ? " read ": " dir ");

4 changes: 3 additions & 1 deletion net/publicfile/patches/patch-filetype.c
@@ -1,4 +1,6 @@
$NetBSD: patch-filetype.c,v 1.1 2013/05/23 14:57:32 joerg Exp $
$NetBSD: patch-filetype.c,v 1.2 2023/11/16 22:55:37 schmonz Exp $

Add missing includes.

--- filetype.c.orig 1999-11-09 07:23:46.000000000 +0000
+++ filetype.c
Expand Down
4 changes: 3 additions & 1 deletion net/publicfile/patches/patch-ftpd.c
@@ -1,4 +1,6 @@
$NetBSD: patch-ftpd.c,v 1.1 2013/05/23 14:57:32 joerg Exp $
$NetBSD: patch-ftpd.c,v 1.2 2023/11/16 22:55:37 schmonz Exp $

Add missing includes.

--- ftpd.c.orig 1999-11-09 07:23:46.000000000 +0000
+++ ftpd.c
Expand Down
29 changes: 27 additions & 2 deletions net/publicfile/patches/patch-httpd.c
@@ -1,6 +1,12 @@
$NetBSD: patch-httpd.c,v 1.1 2013/05/23 14:57:32 joerg Exp $
$NetBSD: patch-httpd.c,v 1.2 2023/11/16 22:55:37 schmonz Exp $

--- httpd.c.orig 1999-11-09 07:23:46.000000000 +0000
Handle request URLs with an https scheme. Look for the client IP in
SSLREMOTEIP if TCPREMOTEIP is not set.
<http://www.superscript.com/patches/publicfile.sslserver>

Add missing includes.

--- httpd.c.orig 2023-11-16 22:51:58.966819579 +0000
+++ httpd.c
@@ -1,3 +1,4 @@
+#include <sys/socket.h>
Expand All @@ -24,3 +30,22 @@
{
int i;
int spaces;
@@ -271,8 +273,16 @@ void doit()
if (!stralloc_copyb(&path,host.s + i,host.len - i)) _exit(21);
host.len = i;
}
- else
- if (!stralloc_copy(&path,&url)) _exit(21);
+ else {
+ if (case_startb(url.s,url.len,"https://")) {
+ if (!stralloc_copyb(&host,url.s + 8,url.len - 8)) _exit(21);
+ i = byte_chr(host.s,host.len,'/');
+ if (!stralloc_copyb(&path,host.s + i,host.len - i)) _exit(21);
+ host.len = i;
+ }
+ else
+ if (!stralloc_copy(&path,&url)) _exit(21);
+ }

if (!path.len || (path.s[path.len - 1] == '/'))
if (!stralloc_cats(&path,"index.html")) _exit(21);
4 changes: 3 additions & 1 deletion net/publicfile/patches/patch-leapsecs__read.c
@@ -1,4 +1,6 @@
$NetBSD: patch-leapsecs__read.c,v 1.1 2013/05/23 14:57:32 joerg Exp $
$NetBSD: patch-leapsecs__read.c,v 1.2 2023/11/16 22:55:37 schmonz Exp $

Add missing includes.

--- leapsecs_read.c.orig 1999-11-09 07:23:46.000000000 +0000
+++ leapsecs_read.c
Expand Down
4 changes: 3 additions & 1 deletion net/publicfile/patches/patch-main.c
@@ -1,4 +1,6 @@
$NetBSD: patch-main.c,v 1.1 2013/05/23 14:57:32 joerg Exp $
$NetBSD: patch-main.c,v 1.2 2023/11/16 22:55:37 schmonz Exp $

Add missing includes.

--- main.c.orig 1999-11-09 07:23:46.000000000 +0000
+++ main.c
Expand Down
4 changes: 3 additions & 1 deletion net/publicfile/patches/patch-open.h
@@ -1,4 +1,6 @@
$NetBSD: patch-open.h,v 1.1 2013/05/23 14:57:32 joerg Exp $
$NetBSD: patch-open.h,v 1.2 2023/11/16 22:55:37 schmonz Exp $

Specify expected parameters.

--- open.h.orig 1999-11-09 07:23:46.000000000 +0000
+++ open.h
Expand Down
4 changes: 3 additions & 1 deletion net/publicfile/patches/patch-prot.c
@@ -1,4 +1,6 @@
$NetBSD: patch-prot.c,v 1.1 2013/05/23 14:57:32 joerg Exp $
$NetBSD: patch-prot.c,v 1.2 2023/11/16 22:55:37 schmonz Exp $

Add missing include.

--- prot.c.orig 1999-11-09 07:23:46.000000000 +0000
+++ prot.c
Expand Down
5 changes: 4 additions & 1 deletion net/publicfile/patches/patch-prot.h
@@ -1,4 +1,7 @@
$NetBSD: patch-prot.h,v 1.1 2013/05/23 14:57:32 joerg Exp $
$NetBSD: patch-prot.h,v 1.2 2023/11/16 22:55:37 schmonz Exp $

Add missing include.
Specify expected parameters.

--- prot.h.orig 1999-11-09 07:23:46.000000000 +0000
+++ prot.h
Expand Down
5 changes: 4 additions & 1 deletion net/publicfile/patches/patch-readwrite.h
@@ -1,4 +1,7 @@
$NetBSD: patch-readwrite.h,v 1.1 2013/05/23 14:57:32 joerg Exp $
$NetBSD: patch-readwrite.h,v 1.2 2023/11/16 22:55:37 schmonz Exp $

Add missing includes.
Add missing prototype.

--- readwrite.h.orig 1999-11-09 07:23:46.000000000 +0000
+++ readwrite.h
Expand Down
4 changes: 3 additions & 1 deletion net/publicfile/patches/patch-utime.c
@@ -1,4 +1,6 @@
$NetBSD: patch-utime.c,v 1.1 2013/05/23 14:57:32 joerg Exp $
$NetBSD: patch-utime.c,v 1.2 2023/11/16 22:55:37 schmonz Exp $

Add missing include.

--- utime.c.orig 1999-11-09 07:23:46.000000000 +0000
+++ utime.c
Expand Down

0 comments on commit 7f11b2d

Please sign in to comment.