projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c0b471e
)
fs-util: suppress world-writable warnings if we read /dev/null
author
Lennart Poettering
<lennart@poettering.net>
Mon, 1 Apr 2019 18:13:36 +0000
(20:13 +0200)
committer
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Mon, 1 Apr 2019 20:07:41 +0000
(22:07 +0200)
Fixes: #12165
src/basic/fs-util.c
patch
|
blob
|
history
diff --git
a/src/basic/fs-util.c
b/src/basic/fs-util.c
index ce1f5454c83e1ba5a67d8067a0a2e4fb0ee204d7..9f3fd4569111ba8e1700a7b9170fc52bb8e8f69f 100644
(file)
--- a/
src/basic/fs-util.c
+++ b/
src/basic/fs-util.c
@@
-353,6
+353,10
@@
int fd_warn_permissions(const char *path, int fd) {
if (fstat(fd, &st) < 0)
return -errno;
+ /* Don't complain if we are reading something that is not a file, for example /dev/null */
+ if (!S_ISREG(st.st_mode))
+ return 0;
+
if (st.st_mode & 0111)
log_warning("Configuration file %s is marked executable. Please remove executable permission bits. Proceeding anyway.", path);