mirror of
https://github.com/systemd/systemd.git
synced 2025-03-22 06:50:18 +03:00
tmpfiles: fix directory removal with force symlink (#8619)
symlink_atomic returns -EISDIR when the target symlink path is a directory. Fixes #7447 Signed-off-by: Ricardo Salveti <ricardo@opensourcefoundries.com>
This commit is contained in:
parent
f6c63f6fc9
commit
2ef5de1bd9
@ -1665,7 +1665,7 @@ static int create_item(Item *i) {
|
||||
r = symlink_atomic(i->argument, i->path);
|
||||
mac_selinux_create_file_clear();
|
||||
|
||||
if (IN_SET(r, -EEXIST, -ENOTEMPTY)) {
|
||||
if (IN_SET(r, -EISDIR, -EEXIST, -ENOTEMPTY)) {
|
||||
r = rm_rf(i->path, REMOVE_ROOT|REMOVE_PHYSICAL);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "rm -fr %s failed: %m", i->path);
|
||||
|
Loading…
x
Reference in New Issue
Block a user