]> git.ipfire.org Git - thirdparty/systemd.git/commit
rm-rf: make sure we can safely remove dirs we have no access to via rm_rf_at()
authorLennart Poettering <lennart@poettering.net>
Wed, 20 Aug 2025 09:39:41 +0000 (11:39 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 24 Oct 2025 15:38:29 +0000 (17:38 +0200)
commit502f7a2b804370d32adb373e661831f583565075
tree65c31524bf776441be1d147073a9231c2cdfaa28
parent28e62e684b631f928f1d857b04f45f0d34441675
rm-rf: make sure we can safely remove dirs we have no access to via rm_rf_at()

Previously, we'd first empty a dir, and then remove it. This works fine
as long as we have access to a dir. But in some cases (like for example
a foreign owned container tree) we might not have access to the dir, but
are still able to remove it (because it is empty, and in a dir we own).
Hence let's try that first. If it works, we do not need to enter the dir
(and thus fail).
src/shared/rm-rf.c