NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/58476: postinstall checks for /var/db/blacklist.db instead of /var/db/blacklistd.db



>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@localhost:/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
 



Home | Main Index | Thread Index | Old Index