NetBSD Problem Report #58476

From www@netbsd.org  Sat Jul 27 15:31:15 2024
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 907EC1A923B
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 27 Jul 2024 15:31:15 +0000 (UTC)
Message-Id: <20240727153114.3D2D21A923C@mollari.NetBSD.org>
Date: Sat, 27 Jul 2024 15:31:14 +0000 (UTC)
From: fstd@pr0.tips
Reply-To: fstd@pr0.tips
To: gnats-bugs@NetBSD.org
Subject: postinstall checks for /var/db/blacklist.db instead of /var/db/blacklistd.db
X-Send-Pr-Version: www-1.0

>Number:         58476
>Category:       bin
>Synopsis:       postinstall checks for /var/db/blacklist.db instead of /var/db/blacklistd.db
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jul 27 15:35:00 +0000 2024
>Originator:     Timo Buhrmester
>Release:        10.0_STABLE
>Organization:
>Environment:
NetBSD lemon.pr0.tips 10.0_STABLE NetBSD 10.0_STABLE (LEMONKERN) #0: Sat Jul 27 04:04:40 CEST 2024  build@kiwi.pr0.tips:/stor/netbsd/foreign/lemon-apu/obj/sys/arch/amd64/compile/LEMONKERN amd64
>Description:
the "blocklist" part of postinstall looks at /var/db/blacklist.db, but the file used to be called /var/db/blacklistd.db instead.

Additionally, while sed(1)-ing files to adjust "blacklistd" to "blocklistd", it's also somewhat sloppy and will hit terms like "blackhole" (e.g. in npf.conf, where it wouldn't be unreasonable to appear)

proposed patch below.
>How-To-Repeat:
upgrade 9 to 10 and do the postinstall dance
>Fix:
--- /tmp/orig	2024-07-27 16:09:02.877570977 +0200
+++ /usr/sbin/postinstall	2024-07-27 16:43:13.971213979 +0200
@@ -941,7 +941,7 @@
 		continue
 	fi

-	if ${GREP} '[bB]lack' "${target}" > /dev/null; then
+	if ${GREP} '[bB]lacklist' "${target}" > /dev/null; then
 		if [ "$1" = "check" ]; then
 			msg "Fix old configuration file(s)."
 			return 1
@@ -966,7 +966,7 @@
 	local i old

 	# if we are actually using blocklistd
-	for i in /var/db/blacklist.db /etc/blacklistd.conf; do
+	for i in /var/db/blacklistd.db /etc/blacklistd.conf; do
 		old="${DEST_DIR}${i}"
 		if [ ! -f "${old}" ]; then
 			continue
@@ -974,7 +974,7 @@
 			msg "Rename old file(s)."
 			return 1
 		fi
-		local new=$(echo "${old}" | ${SED} s/black/block/)
+		local new=$(echo "${old}" | ${SED} s/blacklist/blocklist/)
 		mv "${old}" "${new}" || return 1
 	done

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2024 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.