Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/postinstall deal with blacklist -> blocklist



details:   https://anonhg.NetBSD.org/src/rev/45d001e0e6c7
branches:  trunk
changeset: 934658:45d001e0e6c7
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Jun 15 14:25:40 2020 +0000

description:
deal with blacklist -> blocklist

diffstat:

 usr.sbin/postinstall/postinstall.in |  34 +++++++++++++++++++++++++++++++++-
 1 files changed, 33 insertions(+), 1 deletions(-)

diffs (50 lines):

diff -r 20d160bcba4b -r 45d001e0e6c7 usr.sbin/postinstall/postinstall.in
--- a/usr.sbin/postinstall/postinstall.in       Mon Jun 15 13:57:45 2020 +0000
+++ b/usr.sbin/postinstall/postinstall.in       Mon Jun 15 14:25:40 2020 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall.in,v 1.23 2020/06/03 11:47:46 roy Exp $
+# $NetBSD: postinstall.in,v 1.24 2020/06/15 14:25:40 christos Exp $
 #
 # Copyright (c) 2002-2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -844,6 +844,38 @@
        return ${failed}
 }
 
+fixblock() {
+       for i; do
+               if [ ! -f "$i" ]; then
+                       continue
+               fi
+               local p=$(stat -f %Lp "$i")
+               chmod u+w "$i"
+               sed -i -e s/black/block/g "$i"
+               chmod "$p" "$i"
+       done
+}
+
+#
+#      blocklist update
+#
+additem blocklist "rename old files to blocklist"
+do_blocklist()
+{
+       # if we are actually using blocklistd
+       if [ -f /var/db/blacklist.db ]; then
+               mv /var/db/blocklist.db /var/db/blacklist.db
+       fi
+
+       # if we have fixed the rc files we are done
+       if [ ! -f /etc/rc.d/blacklist ]; then
+               return
+       fi
+
+       fixblock /etc/rc.conf /etc/npf.conf /etc/defaults/rc.conf
+       rm -f /etc/rc.d/blacklist
+}
+
 #
 #      ddbonpanic
 #



Home | Main Index | Thread Index | Old Index