From 8451c4b5afc1ff5366438b2766f75b592c33e1ec Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Fri, 19 Mar 2010 16:44:38 +0200 Subject: [PATCH] lib-master: If binary isn't standalone, enable core dumping at startup. Dropping privileges again should disable dumping, and later it's decided by the binary itself it wants to be dumpable. --HG-- branch : HEAD --- src/lib-master/master-service.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lib-master/master-service.c b/src/lib-master/master-service.c index 43ed8e89a0..947837a2db 100644 --- a/src/lib-master/master-service.c +++ b/src/lib-master/master-service.c @@ -107,6 +107,14 @@ master_service_init(const char *name, enum master_service_flags flags, fd_debug_verify_leaks(MASTER_LISTEN_FD_FIRST + count, 1024); } #endif + if ((flags & MASTER_SERVICE_FLAG_STANDALONE) == 0) { + /* make sure we can dump core, at least until + privileges are dropped. (i'm not really sure why this + is needed, because doing the same just before exec + doesn't help, and exec shouldn't affect this with + non-setuid/gid binaries..) */ + restrict_access_allow_coredumps(TRUE); + } /* NOTE: we start rooted, so keep the code minimal until restrict_access_by_env() is called */ -- 2.47.3