]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/ngircd.c
SECURITY: Fixed a message handling bug which could crash the daemon.
[ngircd-alex.git] / src / ngircd / ngircd.c
index 4cf4ff425af3192b8125d8af958915f7620e0f4d..952a10a435beb4cd0c581be5a2d6ca1103568347 100644 (file)
@@ -84,6 +84,12 @@ main( int argc, const char *argv[] )
        int i;
        size_t n;
 
+#if defined(DEBUG) && defined(HAVE_MTRACE)
+       /* enable GNU libc memory tracing when running in debug mode
+        * and functionality available */
+       mtrace();
+#endif
+
        umask( 0077 );
 
        NGIRCd_SignalQuit = NGIRCd_SignalRestart = NGIRCd_SignalRehash = false;
@@ -784,7 +790,11 @@ NGIRCd_Init( bool NGIRCd_NoDaemon )
                }
 
                /* New child process */
+#ifndef NeXT
                (void)setsid( );
+#else
+               setpgrp(0, getpid());
+#endif
                chdir( "/" );
 
                /* Detach stdin, stdout and stderr */