HomeFreeBSD

cleanvar: Be more careful when cleaning up /var.

Description

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
Approved by: re (cperciva)

(cherry picked from commit 39e8c2a29a860bdb69ffcfbc06de4d4ad103b458)
(cherry picked from commit 0699f0d43416776d87d20d7953b7d686f1e2e572)

Details

Provenance
delphijAuthored on Feb 13 2023, 4:56 AM
Parents
rG50796dea719a: llvm: make sure to use ELFv2 ABI on powerpc64
Branches
Unknown
Tags
Unknown