From: Timo Sirainen Date: Fri, 19 Mar 2010 14:44:38 +0000 (+0200) Subject: lib-master: If binary isn't standalone, enable core dumping at startup. X-Git-Tag: 2.0.beta4~17 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8451c4b5afc1ff5366438b2766f75b592c33e1ec;p=thirdparty%2Fdovecot%2Fcore.git 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 --- 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 */