Skip to content

Commit

Permalink
plugins/old-stats: Remove restrict_access_set_dumpable calls from pro…
Browse files Browse the repository at this point in the history
…cess_io_open().

proc_io_fd is opened in preinit(), while process have root access, so
restrict_access_set_dumpable() calls are not needed.
  • Loading branch information
Sergey-Kitov authored and cmouse committed Apr 26, 2018
1 parent 36ec7f3 commit 6ebb039
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/plugins/old-stats/mail-stats-fill.c
Expand Up @@ -2,7 +2,6 @@

#include "lib.h"
#include "time-util.h"
#include "restrict-access.h"
#include "stats-plugin.h"
#include "mail-stats.h"

Expand Down Expand Up @@ -47,9 +46,6 @@ static int process_io_open(void)
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
Expand All @@ -65,8 +61,6 @@ static int process_io_open(void)
}
errno = EACCES;
}
if (!dumpable)
restrict_access_set_dumpable(FALSE);
if (proc_io_fd == -1) {
/* ignore access errors too, certain security options can
prevent root access to this file when not owned by root */
Expand Down

0 comments on commit 6ebb039

Please sign in to comment.