projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4dfaa52
)
tmpfiles: 'e' is supposed to operate on directory only
author
Franck Bui
<fbui@suse.com>
Tue, 24 Apr 2018 10:23:29 +0000
(12:23 +0200)
committer
Franck Bui
<fbui@suse.com>
Tue, 24 Apr 2018 10:23:29 +0000
(12:23 +0200)
src/tmpfiles/tmpfiles.c
patch
|
blob
|
history
diff --git
a/src/tmpfiles/tmpfiles.c
b/src/tmpfiles/tmpfiles.c
index 4e437a57fd7f26b09436d02ded95a3866d3bbb7e..d52af22d735fe4d07321ce4e5c444f7a8e627460 100644
(file)
--- 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);
}