Module Name: src Committed By: christos Date: Mon Jun 15 21:51:13 UTC 2020
Modified Files: src/usr.sbin/postinstall: postinstall.in Log Message: correct blocklist script - removal of rc file is handled by obsolete - use grep to find if we need more changes - fix rc population To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/usr.sbin/postinstall/postinstall.in Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.sbin/postinstall/postinstall.in diff -u src/usr.sbin/postinstall/postinstall.in:1.25 src/usr.sbin/postinstall/postinstall.in:1.26 --- src/usr.sbin/postinstall/postinstall.in:1.25 Mon Jun 15 10:32:07 2020 +++ src/usr.sbin/postinstall/postinstall.in Mon Jun 15 17:51:13 2020 @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: postinstall.in,v 1.25 2020/06/15 14:32:07 christos Exp $ +# $NetBSD: postinstall.in,v 1.26 2020/06/15 21:51:13 christos Exp $ # # Copyright (c) 2002-2015 The NetBSD Foundation, Inc. # All rights reserved. @@ -862,18 +862,19 @@ fixblock() { additem blocklist "rename old files to blocklist" do_blocklist() { + local rcfiles="/etc/rc.conf /etc/npf.conf /etc/defaults/rc.conf" + # if we are actually using blocklistd if [ -f /var/db/blacklist.db ]; then mv /var/db/blacklist.db /var/db/blocklist.db fi # if we have fixed the rc files we are done - if [ ! -f /etc/rc.d/blacklist ]; then + if ! grep -qs $rcfiles; then return fi - fixblock /etc/rc.conf /etc/npf.conf /etc/defaults/rc.conf - rm -f /etc/rc.d/blacklist + fixblock $rcfiles } # @@ -1618,7 +1619,7 @@ do_rc() fi # Directories of external programs that have rc files (in bsd) - local rc_external_files="blacklist nsd unbound" + local rc_external_files="blocklist nsd unbound" # rc* files in /etc/ # XXX: at least rc.conf and rc.local shouldn't be updated. PR/54741