]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-master: If binary isn't standalone, enable core dumping at startup.
authorTimo Sirainen <tss@iki.fi>
Fri, 19 Mar 2010 14:44:38 +0000 (16:44 +0200)
committerTimo Sirainen <tss@iki.fi>
Fri, 19 Mar 2010 14:44:38 +0000 (16:44 +0200)
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

index 43ed8e89a0f5b84a046952bf6a64aab510312bb4..947837a2dbcffc7d32d6244adadec8a926df666d 100644 (file)
@@ -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 */