]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
cleanvar: Be more careful when cleaning up /var.
authorXin LI <delphij@FreeBSD.org>
Mon, 13 Feb 2023 04:56:17 +0000 (20:56 -0800)
committerXin LI <delphij@FreeBSD.org>
Mon, 13 Feb 2023 04:56:17 +0000 (20:56 -0800)
commit39e8c2a29a860bdb69ffcfbc06de4d4ad103b458
treecb586a675faa700aa9d73c4b45e8e7f63ca53e47
parent81b9905234e34a778dd524385279c2a807d83308
cleanvar: Be more careful when cleaning up /var.

The cleanvar script uses find -delete to remove stale files under /var,
which could lead to unwanted removal of files in some unusual scenarios.
For example, when a mounted fdescfs(5) is present under /var/run/samba/fd,
find(1) could descend into a directory that is out of /var/run and remove
files that should not be removed.

To mitigate this, modify the script to use find -x, which restricts the
find scope to one file system only instead of descending into mounted
file systems.

PR: 269213
MFC after: 1 week
libexec/rc/rc.d/cleanvar