From 53cb00a92b03f855a072d3f85f7b4e6081523b49 Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Sat, 25 Oct 2008 18:45:40 +0000 Subject: [PATCH] Sort `mount -p' output by name before checking for any differences. I noticed on a system at home that restarting named(8) causes the /var/named/dev mount to be moved to the bottom of the mount list, because it gets remounted. When I received the daily security email this morning, I was quite amazed to see that the security report listed the differences, while it was nothing out of the ordinary. If we just throw the `mount -p' output through sort(1), we'll only receive notifications about changes to mounts if something has really changed. --- etc/periodic/security/200.chkmounts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/periodic/security/200.chkmounts b/etc/periodic/security/200.chkmounts index 3b72c5282b5..2558d0e01ff 100755 --- a/etc/periodic/security/200.chkmounts +++ b/etc/periodic/security/200.chkmounts @@ -50,7 +50,7 @@ case "$daily_status_security_chkmounts_enable" in ignore="${ignore}|^amd:" esac [ -n "$ignore" ] && cmd="egrep -v ${ignore#|}" || cmd=cat - mount -p | ${cmd} | + mount -p | sort | ${cmd} | check_diff mount - "${host} changes in mounted filesystems:" rc=$?;; *) rc=0;;