From nobody Thu Oct 30 04:36:54 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cxrtG3BHKz6Dl4N; Thu, 30 Oct 2025 04:36:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cxrtG1k4Nz3M9b; Thu, 30 Oct 2025 04:36:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1761799014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W4H65ouoa/Q8F3iYomGWdBateH5V1VRaPZe8/g2IBjU=; b=lOfDrpasWTOzilv9+ME3Jgf4oMhqcEaugwrdW0wcVqafVGucx+7JbSC/uVQIp04kguYp+Q /YXC57zSSuAugymhwRgSyLNGkhaFrnaGHmRie+rvkpCD9loOgv6qtkSbm+h34ov+Hx+3Kt JlvxtOedb7K2fL0WgWU7zpXgi8qbQHDsBl/ZFiGkk0Cc+hD3zeNMOUIgMSBmYEmfxiB4yj rxWKC5tvQmNd5JkeozY4ILkhE9JTQPtwLDuSHmWWnYbzIFgzDFgBrnXZ6aASvrUvKlucNT juezysn2vRWjYi/RmSeAaPb2FyDiVLp0sNq+ZH28muLP0q7XjfLdDGZmX6cnnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1761799014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W4H65ouoa/Q8F3iYomGWdBateH5V1VRaPZe8/g2IBjU=; b=VA+ffeMIn0UBCcF9P0jxg0uC5gA1wfPU8X64GEFGesZDBluxteIzAzuJxj6vRtzNeJSNR+ sNyMCXdOj/4T5vi8CaH1F6NzWA7SfY3LC7CykPP6aXVDu58NtpRCCgzZEHAK+uQbmd0JBZ jkiL+PxgDPMP3spK5R5nuNgBQJ8G3Ot1wSNSU9Cedu9bGXuQam1g3X4camdw2E9pV8vFT7 X9UEO3spigHvuNwcbiM5LD1q9GoOoIVckbSgnwtLBmww8seK47+c+eQq9qIh/xn98SkAMw 860MVaap63Uozy4OgqbSkPRsmVfpkBbwsFNh6njuNbimcuf6y5kQqXltRcsOzw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1761799014; a=rsa-sha256; cv=none; b=Z9linDBHBRHQAkvC8SU0aV8uaZ5vrh50i3uIUxc/JEji2PKS38NqbJbA2B3HJvG6EEZvXn svHqf7+pWaMVGCwdt8Pi1cuQH/+NzDtcidCZUWT8eNBgZhpfvHVW+VKoGQhwxztqbcheOe +fftojXWzqpoj7XyioLhU11OKpXiq10oaDsGPubvx5lV7RoUPaWLYu7+//q1+GxjQdjoby mMrerhW1+F9nCeWwPNQQo2/41zEVeSQQ9h/IsUChfAUxRQNrY3PKf962nB+/vF7vda4RRw uxspzAULA/TaPU9/kgqHVN1mXiC1JmY3OlJTmQt5fHWB5dYOORr27UveMWamZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cxrtG1Cptz16PQ; Thu, 30 Oct 2025 04:36:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 59U4as8w005021; Thu, 30 Oct 2025 04:36:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59U4asxN005018; Thu, 30 Oct 2025 04:36:54 GMT (envelope-from git) Date: Thu, 30 Oct 2025 04:36:54 GMT Message-Id: <202510300436.59U4asxN005018@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: c4f2ac409c98 - releng/15.0 - blocklist: blacklist: Chase recent upstream changes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/15.0 X-Git-Reftype: branch X-Git-Commit: c4f2ac409c98536a97c0ec7e6dbb09f36f2b18ba Auto-Submitted: auto-generated The branch releng/15.0 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=c4f2ac409c98536a97c0ec7e6dbb09f36f2b18ba commit c4f2ac409c98536a97c0ec7e6dbb09f36f2b18ba Author: Jose Luis Duran AuthorDate: 2025-10-25 21:24:13 +0000 Commit: Colin Percival CommitDate: 2025-10-30 04:36:32 +0000 blocklist: blacklist: Chase recent upstream changes Upstream introduced an extra column in blocklistctl(8) to display the name of the rule associated in the database entry. It is intended to avoid confusion when seemingly duplicate locations appear in the output of the blocklistctl dump command. Especially when users are transitioning from the old nomenclature to the new one. The latest patches will not be fully backported to blacklistctl(8), to avoid breaking current scripts that may be parsing its output. Also we are slowly preparing to feature-freeze everything related to blacklist. Approved by: re (cperciva) MFC: 2 days (cherry picked from commit eae98e28a0e17f625e29f9849a4dc655636d9164) (cherry picked from commit cd284c1e17eab4884cf4bc9479e8272af527f6b7) --- contrib/blocklist/bin/blacklistctl.8 | 3 +-- contrib/blocklist/bin/blacklistd.c | 18 ++++++++---------- contrib/blocklist/bin/blocklistctl.8 | 6 +++++- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/contrib/blocklist/bin/blacklistctl.8 b/contrib/blocklist/bin/blacklistctl.8 index 4d557c0c979d..08f1d1b9e5af 100644 --- a/contrib/blocklist/bin/blacklistctl.8 +++ b/contrib/blocklist/bin/blacklistctl.8 @@ -45,7 +45,6 @@ is a program used to display and change the state of the database. The following sub-commands are supported: .Ss dump -.Pp The following options are available for the .Cm dump sub-command: @@ -90,7 +89,7 @@ associated with the database entry. column will show the identifier for the packet filter rule associated with the database entry, though this may only be the word .Ql OK -for packet filters which do not creat a unique identifier for each rule. +for packet filters which do not create a unique identifier for each rule. .It Ql nfail The number of .Em failures diff --git a/contrib/blocklist/bin/blacklistd.c b/contrib/blocklist/bin/blacklistd.c index ded3075ed707..b5f9358122ef 100644 --- a/contrib/blocklist/bin/blacklistd.c +++ b/contrib/blocklist/bin/blacklistd.c @@ -1,4 +1,4 @@ -/* $NetBSD: blocklistd.c,v 1.10 2025/03/26 17:09:35 christos Exp $ */ +/* $NetBSD: blocklistd.c,v 1.11 2025/10/25 16:55:23 christos Exp $ */ /*- * Copyright (c) 2015 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #ifdef HAVE_SYS_CDEFS_H #include #endif -__RCSID("$NetBSD: blocklistd.c,v 1.10 2025/03/26 17:09:35 christos Exp $"); +__RCSID("$NetBSD: blocklistd.c,v 1.11 2025/10/25 16:55:23 christos Exp $"); #include #include @@ -191,12 +191,12 @@ process(bl_t bl) } if (getremoteaddress(bi, &rss, &rsl) == -1) - goto out; + return; if (debug || bi->bi_msg[0]) { sockaddr_snprintf(rbuf, sizeof(rbuf), "%a:%p", (void *)&rss); (*lfun)(bi->bi_msg[0] ? LOG_INFO : LOG_DEBUG, - "processing type=%d fd=%d remote=%s msg=%s uid=%lu gid=%lu", + "processing type=%d fd=%d remote=%s msg=\"%s\" uid=%lu gid=%lu", bi->bi_type, bi->bi_fd, rbuf, bi->bi_msg, (unsigned long)bi->bi_uid, (unsigned long)bi->bi_gid); @@ -204,12 +204,12 @@ process(bl_t bl) if (conf_find(bi->bi_fd, bi->bi_uid, &rss, &c) == NULL) { (*lfun)(LOG_DEBUG, "no rule matched"); - goto out; + return; } if (state_get(state, &c, &dbi) == -1) - goto out; + return; if (debug) { char b1[128], b2[128]; @@ -226,7 +226,7 @@ process(bl_t bl) * set the number of fails to be one less than the * configured limit. Fallthrough to the normal BL_ADD * processing, which will increment the failure count - * to the threshhold, and block the abusive address. + * to the threshold, and block the abusive address. */ if (c.c_nfail != -1) dbi.count = c.c_nfail - 1; @@ -269,8 +269,6 @@ process(bl_t bl) state_put(state, &c, &dbi); out: - close(bi->bi_fd); - if (debug) { char b1[128], b2[128]; (*lfun)(LOG_DEBUG, "%s: final db state for %s: count=%d/%d " @@ -565,7 +563,7 @@ main(int argc, char *argv[]) conf_parse(configfile); } ret = poll(pfd, (nfds_t)nfd, tout); - if (debug) + if (debug && ret != 0) (*lfun)(LOG_DEBUG, "received %d from poll()", ret); switch (ret) { case -1: diff --git a/contrib/blocklist/bin/blocklistctl.8 b/contrib/blocklist/bin/blocklistctl.8 index 7943c54159c1..75228599a9de 100644 --- a/contrib/blocklist/bin/blocklistctl.8 +++ b/contrib/blocklist/bin/blocklistctl.8 @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd January 27, 2025 +.Dd October 25, 2025 .Dt BLOCKLISTCTL 8 .Os .Sh NAME @@ -82,6 +82,10 @@ sub-command consists of a header (unless was given) and one line for each record in the database, where each line has the following columns: .Bl -tag -width indent +.It Ql rulename +The packet filter rule name associated with the database entry, +usually +.Dv blocklistd . .It Ql address/ma:port The remote address, mask, and local port number of the client connection associated with the database entry.