Skip to content

Commit

Permalink
lib: Call prctl(PR_SET_DUMPABLE) only when PR_SET_DUMPABLE env variab…
Browse files Browse the repository at this point in the history
…le is set
  • Loading branch information
Sergey-Kitov authored and villesavolainen committed Jan 19, 2018
1 parent 0a089f1 commit 572b05e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lib/restrict-access.c
Expand Up @@ -480,8 +480,10 @@ const char *restrict_access_get_current_chroot(void)
void restrict_access_allow_coredumps(bool allow ATTR_UNUSED)
{
#ifdef HAVE_PR_SET_DUMPABLE
if (prctl(PR_SET_DUMPABLE, allow ? 1 : 0, 0, 0, 0) < 0)
i_error("prctl(PR_SET_DUMPABLE) failed: %m");
if (getenv("PR_SET_DUMPABLE") != NULL) {
if (prctl(PR_SET_DUMPABLE, allow ? 1 : 0, 0, 0, 0) < 0)
i_error("prctl(PR_SET_DUMPABLE) failed: %m");
}
#endif
}

Expand Down

0 comments on commit 572b05e

Please sign in to comment.