fs-util: suppress world-writable warnings if we read /dev/null
Fixes: #12165
This commit is contained in:
parent
c0b471e197
commit
b6cceaae30
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue