]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
stats: Do not log errors if /proc/self/io is not accessible
authorAki Tuomi <aki.tuomi@dovecot.fi>
Fri, 24 Nov 2017 07:52:24 +0000 (09:52 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 24 Nov 2017 07:53:54 +0000 (09:53 +0200)
Some security options, used notably in docker, can prevent
access to this file even from root, so do not log errors
if the error is EACCES.

src/plugins/stats/mail-stats-fill.c

index 47c52cf1d270f4d85ee033f3fd70701d8f0c7be9..eb9d4c52fa16b4f83fd8255a1483a8fb3cfc50ff 100644 (file)
@@ -61,7 +61,9 @@ static int process_io_open(void)
                errno = EACCES;
        }
        if (proc_io_fd == -1) {
-               if (errno != ENOENT)
+               /* ignore access errors too, certain security options can
+                  prevent root access to this file when not owned by root */
+               if (errno != ENOENT && errno != EACCES)
                        i_error("open(%s) failed: %m", PROC_IO_PATH);
                proc_io_disabled = TRUE;
                return -1;