diff options
author | Daan De Meyer <daan.j.demeyer@gmail.com> | 2023-06-13 16:01:17 +0200 |
---|---|---|
committer | Daan De Meyer <daan.j.demeyer@gmail.com> | 2023-06-13 16:13:49 +0200 |
commit | a6ae99363d9011bf08bbd7758c5394a5523be7a0 (patch) | |
tree | 3e601771d42c22fcd18031617d7b16c095453453 /src/shared/rm-rf.c | |
parent | fd-util: Add extra shortcut to path_is_root_at() (diff) | |
download | systemd-a6ae99363d9011bf08bbd7758c5394a5523be7a0.tar.xz systemd-a6ae99363d9011bf08bbd7758c5394a5523be7a0.zip |
rm-rf: Fix assertion
This doesn't cover every case but cases where people try to do
rm_rf(dir_fd, ".") are covered by unlinkat() simply failing.
Diffstat (limited to 'src/shared/rm-rf.c')
-rw-r--r-- | src/shared/rm-rf.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/shared/rm-rf.c b/src/shared/rm-rf.c index 3a34281bb9..4664215e90 100644 --- a/src/shared/rm-rf.c +++ b/src/shared/rm-rf.c @@ -430,9 +430,7 @@ int rm_rf_at(int dir_fd, const char *path, RemoveFlags flags) { int fd, r, q = 0; assert(dir_fd >= 0 || dir_fd == AT_FDCWD); - - if (FLAGS_SET(flags, REMOVE_ROOT)) - assert(path && !dot_or_dot_dot(path)); /* unlinkat() does not support AT_EMPTY_PATH or "." so a path must be provided here. */ + assert(path); /* For now, don't support dropping subvols when also only dropping directories, since we can't do * this race-freely. */ |