changeset 22766:42c3dc36e8f9

lib: Add logging of prctl(PR_SET_DUMPABLE) failure.
author Sergey Kitov <sergey.kitov@open-xchange.com>
date Wed, 22 Nov 2017 11:34:47 +0200
parents ed02e59a449c
children 90e946ef71f8
files src/lib/restrict-access.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib/restrict-access.c	Tue Jan 16 18:17:00 2018 +0200
+++ b/src/lib/restrict-access.c	Wed Nov 22 11:34:47 2017 +0200
@@ -480,7 +480,8 @@
 void restrict_access_allow_coredumps(bool allow ATTR_UNUSED)
 {
 #ifdef HAVE_PR_SET_DUMPABLE
-	(void)prctl(PR_SET_DUMPABLE, allow, 0, 0, 0);
+	if (prctl(PR_SET_DUMPABLE, allow ? 1 : 0, 0, 0, 0) < 0)
+		i_error("prctl(PR_SET_DUMPABLE) failed: %m");
 #endif
 }