# HG changeset patch # User Aki Tuomi # Date 1518087888 -7200 # Node ID ce305d3d9b52c20f410fdfccbf6152848c503253 # Parent 44e84dd9b3635777016f15c6d1a51a4fa067f710 old-stats: Set process dumpable during stats gathering /proc/self/io is not accessible otherwise diff -r 44e84dd9b363 -r ce305d3d9b52 src/plugins/stats/mail-stats-fill.c --- a/src/plugins/stats/mail-stats-fill.c Thu Feb 08 13:03:37 2018 +0200 +++ b/src/plugins/stats/mail-stats-fill.c Thu Feb 08 13:04:48 2018 +0200 @@ -2,6 +2,7 @@ #include "lib.h" #include "time-util.h" +#include "restrict-access.h" #include "stats-plugin.h" #include "mail-stats.h" @@ -45,6 +46,10 @@ if (proc_io_disabled) return -1; + + bool dumpable = restrict_access_get_dumpable(); + if (!dumpable) + restrict_access_set_dumpable(TRUE); proc_io_fd = open(PROC_IO_PATH, O_RDONLY); if (proc_io_fd == -1 && errno == EACCES) { /* kludge: if we're running with permissions temporarily @@ -60,6 +65,8 @@ } errno = EACCES; } + if (!dumpable) + restrict_access_set_dumpable(FALSE); if (proc_io_fd == -1) { if (errno != ENOENT) i_error("open(%s) failed: %m", PROC_IO_PATH);