From: Sergey Kitov Date: Tue, 21 Nov 2017 11:27:18 +0000 (+0200) Subject: lib: Call prctl(PR_SET_DUMPABLE) only when PR_SET_DUMPABLE env variable is set X-Git-Tag: 2.3.0.rc1~297 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df65573ad2999461f6bb93e035e54058d8c249a4;p=thirdparty%2Fdovecot%2Fcore.git lib: Call prctl(PR_SET_DUMPABLE) only when PR_SET_DUMPABLE env variable is set --- diff --git a/src/lib/restrict-access.c b/src/lib/restrict-access.c index ba97fd51a7..6661a42db7 100644 --- a/src/lib/restrict-access.c +++ b/src/lib/restrict-access.c @@ -479,8 +479,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 }