1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-02-05 18:05:16 +00:00

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.
This commit is contained in:
Ed Schouten 2008-10-25 18:45:40 +00:00
parent 38a2db2eb0
commit 53cb00a92b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=184265

View File

@ -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;;