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:
Ricardo Salveti de Araujo 2018-04-03 10:05:11 -03:00 committed by Lennart Poettering
parent f6c63f6fc9
commit 2ef5de1bd9
1 changed files with 1 additions and 1 deletions

View File

@ -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);