1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-23 21:35:11 +03:00

tmpfiles: 'e' is supposed to operate on directory only

This commit is contained in:
Franck Bui 2018-04-24 12:23:29 +02:00
parent 4dfaa528d4
commit d460ba18e7

View File

@ -859,6 +859,9 @@ static int path_set_perms(Item *i, const char *path) {
if (fstat(fd, &st) < 0)
return log_error_errno(errno, "Failed to fstat() file %s: %m", path);
if (i->type == EMPTY_DIRECTORY && !S_ISDIR(st.st_mode))
return log_error_errno(EEXIST, "'%s' already exists and is not a directory. ", path);
return fd_set_perms(i, fd, &st);
}