git: 51babd9eb00a - main - net/bsdrcmds: Use blocklist

From: Jose Luis Duran <jlduran_at_FreeBSD.org>
Date: Wed, 02 Sep 2026 19:33:26 UTC
The branch main has been updated by jlduran:

URL: https://cgit.FreeBSD.org/ports/commit/?id=51babd9eb00a5a961fb38b0bef30b01062a3613e

commit 51babd9eb00a5a961fb38b0bef30b01062a3613e
Author:     Jose Luis Duran <jlduran@FreeBSD.org>
AuthorDate: 2026-08-13 18:34:19 +0000
Commit:     Jose Luis Duran <jlduran@FreeBSD.org>
CommitDate: 2026-09-02 19:30:25 +0000

    net/bsdrcmds: Use blocklist
    
    Starting from FreeBSD version 1500000, prefer the new blocklist
    nomenclature.
    
    Once older versions are no longer supported, we should use blocklist
    exclusively.
    
    PR:             295081
---
 net/bsdrcmds/Makefile                              |  31 ++++--
 net/bsdrcmds/distinfo                              |   8 +-
 .../libblacklist-patches/patch-rlogind_Makefile    |  15 +++
 .../libblacklist-patches/patch-rlogind_rlogind.c   |  64 ++++++++++++
 .../files/libblacklist-patches/patch-rshd_Makefile |  15 +++
 .../files/libblacklist-patches/patch-rshd_rshd.c   | 112 +++++++++++++++++++++
 6 files changed, 233 insertions(+), 12 deletions(-)

diff --git a/net/bsdrcmds/Makefile b/net/bsdrcmds/Makefile
index 286637278662..8d02fb548a57 100644
--- a/net/bsdrcmds/Makefile
+++ b/net/bsdrcmds/Makefile
@@ -1,11 +1,8 @@
 PORTNAME=	bsdrcmds
-PORTVERSION=	20171003.01
-PORTREVISION=	1
+PORTVERSION=	20260315
+PORTREVISION=	0
 CATEGORIES=	net
 
-USE_GITHUB=	yes
-GH_ACCOUNT=	jlehen
-
 MAINTAINER=	jlh@FreeBSD.org
 COMMENT=	FreeBSD rcmds (rcp/rlogin/rlogind/rsh/rshd)
 
@@ -13,15 +10,31 @@ LICENSE=	BSD3CLAUSE
 
 USES=		uidfix
 
+USE_GITHUB=	yes
+GH_ACCOUNT=	jlehen
+
 MAKE_ARGS+=		BINOWN=${BINOWN} BINMODE=${BINMODE} MANDIR=${PREFIX}/share/man/man
 MAKE_ENV+=		MK_WERROR=no
 
-OPTIONS_DEFINE=		IPV6 LIBBLACKLIST
-OPTIONS_DEFAULT=	LIBBLACKLIST
+OPTIONS_DEFINE=		IPV6 LIBBLOCKLIST
+OPTIONS_DEFAULT=	LIBBLOCKLIST
 
 IPV6_MAKE_ARGS=		USE_IPV6=yes
 
-LIBBLACKLIST_DESC=	libblacklist(3) support for rlogind(8) and rshd(8)
-LIBBLACKLIST_MAKE_ARGS=	USE_LIBBLACKLIST=yes
+LIBBLOCKLIST_DESC=	libblocklist(3) support for rlogind(8) and rshd(8)
+LIBBLOCKLIST_MAKE_ARGS=	USE_LIBBLOCKLIST=yes
+
+.include <bsd.port.options.mk>
+
+PATCH_SITES=	https://github.com/${GH_ACCOUNT}/${PORTNAME}/pull/
+PATCHFILES=	4.patch
+PATCH_DIST_STRIP=	-p1
+
+.if ${PORT_OPTIONS:MLIBBLOCKLIST}
+. if ${OPSYS} == FreeBSD && ${OSVERSION} < 1500000
+LIBBLOCKLIST_MAKE_ARGS=	USE_LIBBLACKLIST=yes
+EXTRA_PATCHES=		${FILESDIR}/libblacklist-patches
+. endif
+.endif
 
 .include <bsd.port.mk>
diff --git a/net/bsdrcmds/distinfo b/net/bsdrcmds/distinfo
index a1cb989073f9..f9b059220223 100644
--- a/net/bsdrcmds/distinfo
+++ b/net/bsdrcmds/distinfo
@@ -1,3 +1,5 @@
-TIMESTAMP = 1507021885
-SHA256 (jlehen-bsdrcmds-20171003.01_GH0.tar.gz) = 904ce71744493944806b7aa460f4ba3bddfaa7117d7c38505b2d851ccbab301c
-SIZE (jlehen-bsdrcmds-20171003.01_GH0.tar.gz) = 30067
+TIMESTAMP = 1786645762
+SHA256 (jlehen-bsdrcmds-20260315_GH0.tar.gz) = 73d238a59ba2336ded3f459d917bb8caed5a25898bcaf0132a56ffe193889664
+SIZE (jlehen-bsdrcmds-20260315_GH0.tar.gz) = 30254
+SHA256 (4.patch) = 13b20fe13000a3f83d25e4a735425a539b27c284934efe30ad78b049cb7a6f11
+SIZE (4.patch) = 6851
diff --git a/net/bsdrcmds/files/libblacklist-patches/patch-rlogind_Makefile b/net/bsdrcmds/files/libblacklist-patches/patch-rlogind_Makefile
new file mode 100644
index 000000000000..918d56f199d3
--- /dev/null
+++ b/net/bsdrcmds/files/libblacklist-patches/patch-rlogind_Makefile
@@ -0,0 +1,15 @@
+--- rlogind/Makefile.orig	2026-08-13 18:13:34 UTC
++++ rlogind/Makefile
+@@ -13,9 +13,9 @@ CFLAGS+= -DINET6
+ CFLAGS+= -DINET6
+ .endif
+ 
+-.ifdef USE_LIBBLOCKLIST
+-CFLAGS+=	-DUSE_BLOCKLIST
+-LDADD+=		-lblocklist
++.ifdef USE_LIBBLACKLIST
++CFLAGS+=	-DUSE_BLACKLIST
++LDADD+=		-lblacklist
+ .endif
+ 
+ .include <bsd.prog.mk>
diff --git a/net/bsdrcmds/files/libblacklist-patches/patch-rlogind_rlogind.c b/net/bsdrcmds/files/libblacklist-patches/patch-rlogind_rlogind.c
new file mode 100644
index 000000000000..983e33af4bc4
--- /dev/null
+++ b/net/bsdrcmds/files/libblacklist-patches/patch-rlogind_rlogind.c
@@ -0,0 +1,64 @@
+--- rlogind/rlogind.c.orig	2026-08-13 18:14:28 UTC
++++ rlogind/rlogind.c
+@@ -83,8 +83,8 @@ __FBSDID("$FreeBSD: head/libexec/rlogind/rlogind.c 301
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
+-#ifdef USE_BLOCKLIST
+-#include <blocklist.h>
++#ifdef USE_BLACKLIST
++#include <blacklist.h>
+ #endif
+ 
+ #ifndef TIOCPKT_WINDOW
+@@ -231,8 +231,8 @@ doit(int f, union sockunion *fromp)
+ 			/* error check ? */
+ 			syslog(LOG_NOTICE, "Connection from %s on illegal port",
+ 			       nameinfo);
+-#ifdef USE_BLOCKLIST
+-			blocklist(1, STDIN_FILENO, "illegal port");
++#ifdef USE_BLACKLIST
++			blacklist(1, STDIN_FILENO, "illegal port");
+ #endif
+ 			fatal(f, "Permission denied", 0);
+ 		}
+@@ -257,8 +257,8 @@ doit(int f, union sockunion *fromp)
+ 						"Connection refused from %s with IP option %s",
+ 						inet_ntoa(fromp->su_sin.sin_addr),
+ 						c == IPOPT_LSRR ? "LSRR" : "SSRR");
+-#ifdef USE_BLOCKLIST
+-					blocklist(1, STDIN_FILENO, "source routing present");
++#ifdef USE_BLACKLIST
++					blacklist(1, STDIN_FILENO, "source routing present");
+ #endif
+ 					exit(1);
+ 				}
+@@ -292,13 +292,13 @@ doit(int f, union sockunion *fromp)
+ 		if (*lusername=='-') {
+ 			syslog(LOG_ERR, "tried to pass user \"%s\" to login",
+ 			       lusername);
+-#ifdef USE_BLOCKLIST
+-			blocklist(1, STDIN_FILENO, "invalid user");
++#ifdef USE_BLACKLIST
++			blacklist(1, STDIN_FILENO, "invalid user");
+ #endif
+ 			fatal(STDERR_FILENO, "invalid user", 0);
+ 		}
+-#ifdef USE_BLOCKLIST
+-		blocklist(0, STDIN_FILENO, "success");
++#ifdef USE_BLACKLIST
++		blacklist(0, STDIN_FILENO, "success");
+ #endif
+ 		if (authenticated) {
+ 			execl(_PATH_LOGIN, "login", "-p",
+@@ -519,8 +519,8 @@ getstr(char *buf, int cnt, char *errmsg)
+ 		if (read(STDIN_FILENO, &c, 1) != 1)
+ 			exit(1);
+ 		if (--cnt < 0) {
+-#ifdef USE_BLOCKLIST
+-			blocklist(1, STDIN_FILENO, "buffer overflow");
++#ifdef USE_BLACKLIST
++			blacklist(1, STDIN_FILENO, "buffer overflow");
+ #endif
+ 			fatal(STDOUT_FILENO, errmsg, 0);
+ 		}
diff --git a/net/bsdrcmds/files/libblacklist-patches/patch-rshd_Makefile b/net/bsdrcmds/files/libblacklist-patches/patch-rshd_Makefile
new file mode 100644
index 000000000000..610908cde0dd
--- /dev/null
+++ b/net/bsdrcmds/files/libblacklist-patches/patch-rshd_Makefile
@@ -0,0 +1,15 @@
+--- rshd/Makefile.orig	2026-08-13 18:15:09 UTC
++++ rshd/Makefile
+@@ -14,9 +14,9 @@ LDADD=	-lutil -lpam
+ 
+ LDADD=	-lutil -lpam
+ 
+-.ifdef USE_LIBBLOCKLIST
+-CFLAGS+=	-DUSE_BLOCKLIST
+-LDADD+=		-lblocklist
++.ifdef USE_LIBBLACKLIST
++CFLAGS+=	-DUSE_BLACKLIST
++LDADD+=		-lblacklist
+ .endif
+ 
+ .include <bsd.prog.mk>
diff --git a/net/bsdrcmds/files/libblacklist-patches/patch-rshd_rshd.c b/net/bsdrcmds/files/libblacklist-patches/patch-rshd_rshd.c
new file mode 100644
index 000000000000..20d475469443
--- /dev/null
+++ b/net/bsdrcmds/files/libblacklist-patches/patch-rshd_rshd.c
@@ -0,0 +1,112 @@
+--- rshd/rshd.c.orig	2026-08-13 18:15:38 UTC
++++ rshd/rshd.c
+@@ -88,8 +88,8 @@ __FBSDID("$FreeBSD: head/libexec/rshd/rshd.c 320406 20
+ #include <security/openpam.h>
+ #include <sys/wait.h>
+ 
+-#ifdef USE_BLOCKLIST
+-#include <blocklist.h>
++#ifdef USE_BLACKLIST
++#include <blacklist.h>
+ #endif
+ 
+ static struct pam_conv pamc = { openpam_nullconv, NULL };
+@@ -256,8 +256,8 @@ doit(struct sockaddr *fromp)
+ 		    "connection from %s on illegal port %u",
+ 		    numericname,
+ 		    srcport);
+-#ifdef USE_BLOCKLIST
+-		blocklist(1, STDIN_FILENO, "illegal port");
++#ifdef USE_BLACKLIST
++		blacklist(1, STDIN_FILENO, "illegal port");
+ #endif
+ 		exit(1);
+ 	}
+@@ -292,8 +292,8 @@ doit(struct sockaddr *fromp)
+ 			    "2nd socket from %s on unreserved port %u",
+ 			    numericname,
+ 			    port);
+-#ifdef USE_BLOCKLIST
+-			blocklist(1, STDIN_FILENO, "unreserved port");
++#ifdef USE_BLACKLIST
++			blacklist(1, STDIN_FILENO, "unreserved port");
+ #endif
+ 			exit(1);
+ 		}
+@@ -319,8 +319,8 @@ doit(struct sockaddr *fromp)
+ 	if (pam_err != PAM_SUCCESS) {
+ 		syslog(LOG_ERR|LOG_AUTH, "pam_start(): %s",
+ 		    pam_strerror(pamh, pam_err));
+-#ifdef USE_BLOCKLIST
+-		blocklist(1, STDIN_FILENO, "login incorrect");
++#ifdef USE_BLACKLIST
++		blacklist(1, STDIN_FILENO, "login incorrect");
+ #endif
+ 		rshd_errx(1, "Login incorrect.");
+ 	}
+@@ -329,8 +329,8 @@ doit(struct sockaddr *fromp)
+ 	    (pam_err = pam_set_item(pamh, PAM_RHOST, rhost)) != PAM_SUCCESS) {
+ 		syslog(LOG_ERR|LOG_AUTH, "pam_set_item(): %s",
+ 		    pam_strerror(pamh, pam_err));
+-#ifdef USE_BLOCKLIST
+-		blocklist(1, STDIN_FILENO, "login incorrect");
++#ifdef USE_BLACKLIST
++		blacklist(1, STDIN_FILENO, "login incorrect");
+ #endif
+ 		rshd_errx(1, "Login incorrect.");
+ 	}
+@@ -348,8 +348,8 @@ doit(struct sockaddr *fromp)
+ 		syslog(LOG_INFO|LOG_AUTH,
+ 		    "%s@%s as %s: permission denied (%s). cmd='%.80s'",
+ 		    ruser, rhost, luser, pam_strerror(pamh, pam_err), cmdbuf);
+-#ifdef USE_BLOCKLIST
+-		blocklist(1, STDIN_FILENO, "permission denied");
++#ifdef USE_BLACKLIST
++		blacklist(1, STDIN_FILENO, "permission denied");
+ #endif
+ 		rshd_errx(1, "Login incorrect.");
+ 	}
+@@ -360,8 +360,8 @@ doit(struct sockaddr *fromp)
+ 		syslog(LOG_INFO|LOG_AUTH,
+ 		    "%s@%s as %s: unknown login. cmd='%.80s'",
+ 		    ruser, rhost, luser, cmdbuf);
+-#ifdef USE_BLOCKLIST
+-		blocklist(1, STDIN_FILENO, "unknown login");
++#ifdef USE_BLACKLIST
++		blacklist(1, STDIN_FILENO, "unknown login");
+ #endif
+ 		if (errorstr == NULL)
+ 			errorstr = "Login incorrect.";
+@@ -395,8 +395,8 @@ doit(struct sockaddr *fromp)
+ 			    "%s@%s as %s: permission denied (%s). cmd='%.80s'",
+ 			    ruser, rhost, luser, __rcmd_errstr,
+ 			    cmdbuf);
+-#ifdef USE_BLOCKLIST
+-			blocklist(1, STDIN_FILENO, "permission denied");
++#ifdef USE_BLACKLIST
++			blacklist(1, STDIN_FILENO, "permission denied");
+ #endif
+ 			rshd_errx(1, "Login incorrect.");
+ 		}
+@@ -493,8 +493,8 @@ doit(struct sockaddr *fromp)
+ 		}
+ 	}
+ 
+-#ifdef USE_BLOCKLIST
+-	blocklist(0, STDIN_FILENO, "success");
++#ifdef USE_BLACKLIST
++	blacklist(0, STDIN_FILENO, "success");
+ #endif
+ 	closefrom(3);
+ 	if (setsid() == -1)
+@@ -562,8 +562,8 @@ getstr(char *buf, int cnt, const char *error)
+ 			exit(1);
+ 		*buf++ = c;
+ 		if (--cnt == 0) {
+-#ifdef USE_BLOCKLIST
+-			blocklist(1, STDIN_FILENO, "buffer overflow");
++#ifdef USE_BLACKLIST
++			blacklist(1, STDIN_FILENO, "buffer overflow");
+ #endif
+ 			rshd_errx(1, "%s too long", error);
+ 		}