diff --git a/ftp/freebsd-ftpd/Makefile b/ftp/freebsd-ftpd/Makefile index e6559b2f66f5..c7c8017dd753 100644 --- a/ftp/freebsd-ftpd/Makefile +++ b/ftp/freebsd-ftpd/Makefile @@ -1,40 +1,41 @@ PORTNAME= freebsd-ftpd DISTVERSIONPREFIX= v -DISTVERSION= 20260507 +DISTVERSION= 20260507a PORTREVISION= 1 CATEGORIES= ftp MAINTAINER= cy@FreeBSD.org COMMENT= FreeBSD ftpd WWW= https://github.com/cschuber/freebsd-ftpd LICENSE= BSD3CLAUSE USES= uidfix USE_GITHUB= yes GH_ACCOUNT= cschuber USE_RC_SUBR= ftpd MAKE_ARGS+= BINOWN=${BINOWN} BINMODE=${BINMODE} MAKE_ENV+= MAKESYSPATH=/usr/src/share/mk \ BINDIR=${PREFIX}/libexec \ MANDIR=${PREFIX}/share/man/man \ MK_WERROR=no OPTIONS_DEFINE= IPV6 LIBBLOCKLIST OPTIONS_DEFAULT= IPV6 LIBBLOCKLIST LIBBLOCKLIST_DESC= libblocklist(3) support for rlogind(8) and rshd(8) LIBBLOCKLIST_MAKE_ARGS= USE_LIBBLOCKLIST=yes .include .if ${PORT_OPTIONS:MLIBBLOCKLIST} . if ${OPSYS} == FreeBSD && ${OSVERSION} < 1500000 -LIBBLOCKLIST_MAKE_ARGS= USE_LIBBLOCKLIST=yes +LIBBLOCKLIST_MAKE_ARGS= USE_LIBBLACKLIST=yes +EXTRA_PATCHES= ${FILESDIR}/libblacklist-patches . endif .endif .include diff --git a/ftp/freebsd-ftpd/distinfo b/ftp/freebsd-ftpd/distinfo index 17d741ee98d1..e6d33dd622c0 100644 --- a/ftp/freebsd-ftpd/distinfo +++ b/ftp/freebsd-ftpd/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1778164397 -SHA256 (cschuber-freebsd-ftpd-v20260507_GH0.tar.gz) = 06e5723946f48e26d4138b71806f305a8f9367a57f36a0d18c7149d770224c1e -SIZE (cschuber-freebsd-ftpd-v20260507_GH0.tar.gz) = 48009 +TIMESTAMP = 1778174430 +SHA256 (cschuber-freebsd-ftpd-v20260507a_GH0.tar.gz) = 71d297508085869ae54c9c97ddc0a667192181eb18aad2788a8618b6573b998f +SIZE (cschuber-freebsd-ftpd-v20260507a_GH0.tar.gz) = 48007 diff --git a/ftp/freebsd-ftpd/files/libblacklist-patches/patch-Makefile b/ftp/freebsd-ftpd/files/libblacklist-patches/patch-Makefile new file mode 100644 index 000000000000..fe2d400acfbc --- /dev/null +++ b/ftp/freebsd-ftpd/files/libblacklist-patches/patch-Makefile @@ -0,0 +1,19 @@ +--- Makefile.orig 2026-05-07 15:14:30 UTC ++++ Makefile +@@ -21,11 +21,11 @@ LIBADD+= m + CFLAGS+=-Dmain=ls_main -I${SRCTOP}/bin/ls + LIBADD+= m + +-.if ${MK_BLOCKLIST_SUPPORT} != "no" +-CFLAGS+= -DUSE_BLOCKLIST -I${SRCTOP}/contrib/blocklist/include +-SRCS+= blocklist.c +-LIBADD+= blocklist +-LDFLAGS+=-L${LIBBLOCKLISTDIR} ++.if ${MK_BLACKLIST_SUPPORT} != "no" ++CFLAGS+= -DUSE_BLACKLIST -I${SRCTOP}/contrib/blacklist/include ++SRCS+= blacklist.c ++LIBADD+= blacklist ++LDFLAGS+=-L${LIBBLACKLISTDIR} + .endif + + .if ${MK_INET6_SUPPORT} != "no" diff --git a/ftp/freebsd-ftpd/files/libblacklist-patches/patch-Makefile.depend.options b/ftp/freebsd-ftpd/files/libblacklist-patches/patch-Makefile.depend.options new file mode 100644 index 000000000000..c95121b048ee --- /dev/null +++ b/ftp/freebsd-ftpd/files/libblacklist-patches/patch-Makefile.depend.options @@ -0,0 +1,9 @@ +--- Makefile.depend.options.orig 2026-05-07 15:15:21 UTC ++++ Makefile.depend.options +@@ -1,5 +1,5 @@ + # This file is not autogenerated - take care! + +-DIRDEPS_OPTIONS= BLOCKLIST_SUPPORT PAM_SUPPORT ++DIRDEPS_OPTIONS= BLACKLIST_SUPPORT PAM_SUPPORT + + .include diff --git a/ftp/freebsd-ftpd/files/libblacklist-patches/patch-blacklist.c b/ftp/freebsd-ftpd/files/libblacklist-patches/patch-blacklist.c new file mode 100644 index 000000000000..9837de24b831 --- /dev/null +++ b/ftp/freebsd-ftpd/files/libblacklist-patches/patch-blacklist.c @@ -0,0 +1,58 @@ +--- blacklist.c.orig 2026-05-07 15:10:31 UTC ++++ blacklist.c +@@ -0,0 +1,55 @@ ++/*- ++ * Copyright (c) 2016 The FreeBSD Foundation ++ * ++ * This software was developed by Kurt Lidl under sponsorship from the ++ * FreeBSD Foundation. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE ++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ++ * SUCH DAMAGE. */ ++ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include "blacklist_client.h" ++ ++static struct blacklist *blstate; ++extern int use_blacklist; ++ ++void ++blacklist_init(void) ++{ ++ ++ if (use_blacklist) ++ blstate = blacklist_open(); ++} ++ ++void ++blacklist_notify(int action, int fd, const char *msg) ++{ ++ ++ if (blstate == NULL) ++ return; ++ (void)blacklist_r(blstate, action, fd, msg); ++} diff --git a/ftp/freebsd-ftpd/files/libblacklist-patches/patch-blacklist__client.h b/ftp/freebsd-ftpd/files/libblacklist-patches/patch-blacklist__client.h new file mode 100644 index 000000000000..f16063872e4b --- /dev/null +++ b/ftp/freebsd-ftpd/files/libblacklist-patches/patch-blacklist__client.h @@ -0,0 +1,56 @@ +--- blacklist_client.h.orig 2026-05-07 15:13:26 UTC ++++ blacklist_client.h +@@ -0,0 +1,53 @@ ++/*- ++ * Copyright (c) 2016 The FreeBSD Foundation ++ * ++ * This software was developed by Kurt Lidl under sponsorship from the ++ * FreeBSD Foundation. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE ++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ++ * SUCH DAMAGE. */ ++ ++ ++#ifndef BLACKLIST_CLIENT_H ++#define BLACKLIST_CLIENT_H ++ ++#ifndef BLACKLIST_API_ENUM ++enum { ++ BLACKLIST_AUTH_OK = 0, ++ BLACKLIST_AUTH_FAIL ++}; ++#endif ++ ++#ifdef USE_BLACKLIST ++void blacklist_init(void); ++void blacklist_notify(int, int, const char *); ++ ++#define BLACKLIST_INIT() blacklist_init() ++#define BLACKLIST_NOTIFY(x, y, z) blacklist_notify(x, y, z) ++ ++#else ++ ++#define BLACKLIST_INIT() ++#define BLACKLIST_NOTIFY(x, y, z) ++ ++#endif ++ ++#endif /* BLACKLIST_CLIENT_H */ diff --git a/ftp/freebsd-ftpd/files/libblacklist-patches/patch-blocklist.c b/ftp/freebsd-ftpd/files/libblacklist-patches/patch-blocklist.c new file mode 100644 index 000000000000..4181b70c16be --- /dev/null +++ b/ftp/freebsd-ftpd/files/libblacklist-patches/patch-blocklist.c @@ -0,0 +1,58 @@ +--- blocklist.c.orig 2026-05-07 15:09:10 UTC ++++ blocklist.c +@@ -1,55 +0,0 @@ +-/*- +- * Copyright (c) 2016 The FreeBSD Foundation +- * +- * This software was developed by Kurt Lidl under sponsorship from the +- * FreeBSD Foundation. +- * +- * Redistribution and use in source and binary forms, with or without +- * modification, are permitted provided that the following conditions +- * are met: +- * 1. Redistributions of source code must retain the above copyright +- * notice, this list of conditions and the following disclaimer. +- * 2. Redistributions in binary form must reproduce the above copyright +- * notice, this list of conditions and the following disclaimer in the +- * documentation and/or other materials provided with the distribution. +- * +- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +- * SUCH DAMAGE. */ +- +- +-#include +-#include +-#include +-#include +- +-#include +-#include "blocklist_client.h" +- +-static struct blocklist *blstate; +-extern int use_blocklist; +- +-void +-blocklist_init(void) +-{ +- +- if (use_blocklist) +- blstate = blocklist_open(); +-} +- +-void +-blocklist_notify(int action, int fd, const char *msg) +-{ +- +- if (blstate == NULL) +- return; +- (void)blocklist_r(blstate, action, fd, msg); +-} diff --git a/ftp/freebsd-ftpd/files/libblacklist-patches/patch-blocklist__client.h b/ftp/freebsd-ftpd/files/libblacklist-patches/patch-blocklist__client.h new file mode 100644 index 000000000000..4b7dca5cf471 --- /dev/null +++ b/ftp/freebsd-ftpd/files/libblacklist-patches/patch-blocklist__client.h @@ -0,0 +1,56 @@ +--- blocklist_client.h.orig 2026-05-07 15:12:54 UTC ++++ blocklist_client.h +@@ -1,53 +0,0 @@ +-/*- +- * Copyright (c) 2016 The FreeBSD Foundation +- * +- * This software was developed by Kurt Lidl under sponsorship from the +- * FreeBSD Foundation. +- * +- * Redistribution and use in source and binary forms, with or without +- * modification, are permitted provided that the following conditions +- * are met: +- * 1. Redistributions of source code must retain the above copyright +- * notice, this list of conditions and the following disclaimer. +- * 2. Redistributions in binary form must reproduce the above copyright +- * notice, this list of conditions and the following disclaimer in the +- * documentation and/or other materials provided with the distribution. +- * +- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +- * SUCH DAMAGE. */ +- +- +-#ifndef BLOCKLIST_CLIENT_H +-#define BLOCKLIST_CLIENT_H +- +-#ifndef BLOCKLIST_API_ENUM +-enum { +- BLOCKLIST_AUTH_OK = 0, +- BLOCKLIST_AUTH_FAIL +-}; +-#endif +- +-#ifdef USE_BLOCKLIST +-void blocklist_init(void); +-void blocklist_notify(int, int, const char *); +- +-#define BLOCKLIST_INIT() blocklist_init() +-#define BLOCKLIST_NOTIFY(x, y, z) blocklist_notify(x, y, z) +- +-#else +- +-#define BLOCKLIST_INIT() +-#define BLOCKLIST_NOTIFY(x, y, z) +- +-#endif +- +-#endif /* BLOCKLIST_CLIENT_H */ diff --git a/ftp/freebsd-ftpd/files/libblacklist-patches/patch-ftpd.8 b/ftp/freebsd-ftpd/files/libblacklist-patches/patch-ftpd.8 new file mode 100644 index 000000000000..b1df8170b32a --- /dev/null +++ b/ftp/freebsd-ftpd/files/libblacklist-patches/patch-ftpd.8 @@ -0,0 +1,15 @@ +--- ftpd.8.orig 2026-05-07 15:11:19 UTC ++++ ftpd.8 +@@ -96,10 +96,10 @@ sends authentication success and failure messages to t + With this option set, + .Nm + sends authentication success and failure messages to the +-.Xr blocklistd 8 ++.Xr blacklistd 8 + daemon. + If this option is not specified, no communication with the +-.Xr blocklistd 8 ++.Xr blacklistd 8 + daemon is attempted. + .It Fl D + With this option set, diff --git a/ftp/freebsd-ftpd/files/libblacklist-patches/patch-ftpd.c b/ftp/freebsd-ftpd/files/libblacklist-patches/patch-ftpd.c new file mode 100644 index 000000000000..08d8a73b0d58 --- /dev/null +++ b/ftp/freebsd-ftpd/files/libblacklist-patches/patch-ftpd.c @@ -0,0 +1,79 @@ +--- ftpd.c.orig 2026-05-07 15:15:50 UTC ++++ ftpd.c +@@ -77,7 +77,7 @@ + #include + #endif + +-#include "blocklist_client.h" ++#include "blacklist_client.h" + #include "pathnames.h" + #include "extern.h" + +@@ -126,7 +126,7 @@ int noguestmod = 1; /* anon users may not modify exis + int noguestretr = 0; /* RETR command is disabled for anon users. */ + int noguestmkd = 0; /* MKD command is disabled for anon users. */ + int noguestmod = 1; /* anon users may not modify existing files. */ +-int use_blocklist = 0; ++int use_blacklist = 0; + + off_t file_size; + off_t byte_count; +@@ -293,10 +293,10 @@ main(int argc, char *argv[], char **envp) + break; + + case 'B': +-#ifdef USE_BLOCKLIST +- use_blocklist = 1; ++#ifdef USE_BLACKLIST ++ use_blacklist = 1; + #else +- syslog(LOG_WARNING, "not compiled with USE_BLOCKLIST support"); ++ syslog(LOG_WARNING, "not compiled with USE_BLACKLIST support"); + #endif + break; + +@@ -630,7 +630,7 @@ gotchild: + reply(220, "%s FTP server (%s) ready.", hostname, version); + else + reply(220, "FTP server ready."); +- BLOCKLIST_INIT(); ++ BLACKLIST_INIT(); + for (;;) + (void) yyparse(); + /* NOTREACHED */ +@@ -1043,7 +1043,7 @@ user(char *name) + (checkuser(_PATH_FTPUSERS, name, 1, NULL, &ecode) || + (ecode != 0 && ecode != ENOENT))) { + reply(530, "User %s access denied.", name); +- BLOCKLIST_NOTIFY(BLOCKLIST_AUTH_FAIL, STDIN_FILENO, "Access denied"); ++ BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL, STDIN_FILENO, "Access denied"); + if (logging) + syslog(LOG_NOTICE, + "FTP LOGIN REFUSED FROM %s, %s", +@@ -1387,7 +1387,7 @@ skip: + */ + if (rval) { + reply(530, "Login incorrect."); +- BLOCKLIST_NOTIFY(BLOCKLIST_AUTH_FAIL, STDIN_FILENO, "Login incorrect"); ++ BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL, STDIN_FILENO, "Login incorrect"); + if (logging) { + syslog(LOG_NOTICE, + "FTP LOGIN FAILED FROM %s", +@@ -1405,7 +1405,7 @@ skip: + } + return; + } else { +- BLOCKLIST_NOTIFY(BLOCKLIST_AUTH_OK, STDIN_FILENO, "Login successful"); ++ BLACKLIST_NOTIFY(BLACKLIST_AUTH_OK, STDIN_FILENO, "Login successful"); + } + } + login_attempts = 0; /* this time successful */ +@@ -1425,7 +1425,7 @@ skip: + *remote_ip = 0; + remote_ip[sizeof(remote_ip) - 1] = 0; + if (!auth_hostok(lc, remotehost, remote_ip)) { +- BLOCKLIST_NOTIFY(BLOCKLIST_AUTH_FAIL, STDIN_FILENO, "Permission denied"); ++ BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL, STDIN_FILENO, "Permission denied"); + syslog(LOG_INFO|LOG_AUTH, + "FTP LOGIN FAILED (HOST) as %s: permission denied.", + pw->pw_name);