PR misc/7716: add configuration options find_core_ignore_fstypes and trunk
authorerh <erh@NetBSD.org>
Tue, 28 Sep 2004 15:03:58 +0000
branchtrunk
changeset 130733 d95151b04913
parent 130732 1f94ba9a267b
child 130734 be7b45c9f5f4
PR misc/7716: add configuration options find_core_ignore_fstypes and check_devices_ignore_fstypes to allow the filesystem types that are ignored during the daily and security runs to be adjusted.
etc/daily
etc/defaults/daily.conf
etc/defaults/security.conf
etc/security
--- a/etc/daily	Tue Sep 28 14:44:05 2004 +0000
+++ b/etc/daily	Tue Sep 28 15:03:58 2004 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh -
 #
-#	$NetBSD: daily,v 1.61 2004/05/28 03:55:30 martin Exp $
+#	$NetBSD: daily,v 1.62 2004/09/28 15:03:58 erh Exp $
 #	@(#)daily	8.2 (Berkeley) 1/25/94
 #
 
@@ -79,9 +79,11 @@
 TMP2=daily2.$$
 
 if checkyesno find_core; then
-	find / \( ! -fstype local -o -fstype rdonly -o -fstype fdesc \
-		-o -fstype null \
-		-o -fstype kernfs -o -fstype procfs \) -prune -o \
+	# Turn "foo !bar bax" into "-fstype foo -o ! -fstype bar -o -fstype bax"
+	ignfstypes=`echo $find_core_ignore_fstypes | \
+		sed -e's/\(!*\)\([^[:space:]]\{1,\}\)/-o \1 -fstype \2/g' \
+		    -e's/^-o //'`
+	find / \( $ignfstypes \) -prune -o \
 		-name 'lost+found' -prune -o \
 		\( -name '*.core' -o -name 'core' \) -type f -print > $TMP
 #		\( -name '[#,]*' -o -name '.#*' -o -name a.out \
--- a/etc/defaults/daily.conf	Tue Sep 28 14:44:05 2004 +0000
+++ b/etc/defaults/daily.conf	Tue Sep 28 15:03:58 2004 +0000
@@ -1,4 +1,4 @@
-#	$NetBSD: daily.conf,v 1.6 2003/12/08 01:14:08 perry Exp $
+#	$NetBSD: daily.conf,v 1.7 2004/09/28 15:03:58 erh Exp $
 #
 # /etc/defaults/daily.conf --
 #	default configuration of /etc/daily.conf
@@ -10,6 +10,7 @@
 #
 
 find_core=YES
+find_core_ignore_fstypes="!local rdonly fdesc null kernfs procfs"
 expire_news=NO
 purge_accounting=YES
 run_msgs=YES
--- a/etc/defaults/security.conf	Tue Sep 28 14:44:05 2004 +0000
+++ b/etc/defaults/security.conf	Tue Sep 28 15:03:58 2004 +0000
@@ -1,4 +1,4 @@
-#	$NetBSD: security.conf,v 1.12 2003/11/18 03:21:40 jhawk Exp $
+#	$NetBSD: security.conf,v 1.13 2004/09/28 15:03:58 erh Exp $
 #
 # /etc/defaults/security.conf --
 #	default configuration of /etc/security.conf
@@ -31,6 +31,8 @@
 
 check_homes_permit_usergroups=NO
 
+check_devices_ignore_fstypes="!local fdesc kernfs null procfs"
+
 check_mtree_follow_symlinks=NO
 
 check_passwd_nowarn_shells="/sbin/nologin /usr/libexec/uucp/uucico"
--- a/etc/security	Tue Sep 28 14:44:05 2004 +0000
+++ b/etc/security	Tue Sep 28 15:03:58 2004 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh -
 #
-#	$NetBSD: security,v 1.91 2004/07/23 06:12:16 lukem Exp $
+#	$NetBSD: security,v 1.92 2004/09/28 15:03:58 erh Exp $
 #	from: @(#)security	8.1 (Berkeley) 6/9/93
 #
 
@@ -599,9 +599,12 @@
 #
 if checkyesno check_devices; then
 	> $ERR
-	(find / \( ! -fstype local -o -fstype fdesc -o -fstype kernfs \
-			-o -fstype null \
-			-o -fstype procfs \) -a -prune -o \
+	(
+	# Turn "foo !bar bax" into "-fstype foo -o ! -fstype bar -o -fstype bax"
+	ignfstypes=`echo $check_devices_ignore_fstypes | \
+		sed -e's/\(!*\)\([^[:space:]]\{1,\}\)/-o \1 -fstype \2/g' \
+		    -e's/^-o //'`
+	find / \( $ignfstypes \) -a -prune -o \
 	    \( \( -perm -u+s -a ! -type d \) -o \
 	       \( -perm -g+s -a ! -type d \) -o \
 	       -type b -o -type c \) -print0 | \