From: Franck Bui Date: Tue, 24 Apr 2018 10:23:29 +0000 (+0200) Subject: tmpfiles: 'e' is supposed to operate on directory only X-Git-Tag: v239~363^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d460ba18e777128c19343b067574ecac399f3afc;p=thirdparty%2Fsystemd.git tmpfiles: 'e' is supposed to operate on directory only --- diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c index 4e437a57fd7..d52af22d735 100644 --- a/src/tmpfiles/tmpfiles.c +++ b/src/tmpfiles/tmpfiles.c @@ -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); }