Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor recursive deletion into a struct maintaining the dir stack
it can remove arbitrarily-deep directory trees without exhausting the stack or file descriptor limits. The symlink attack/TOCTOU from CVE-2022-21658 that can occur when traversing the directory hierarchy more than level at a time is addressed by retracing the .. hierarchy after opening a descendant. Opening .. isn't subject to symlink attacks so we can reliably compare dev/ino numbers.
- Loading branch information