Skip to contentSkip to conversation

ulogd segfault on kill TERM

PATCH Salih Gönüllü 2 participants 2 messages Mar 24, 2011 – Mar 27, 2011

lore
Share & tools
lore
#0 lore raw

Hi,

ulogd is segfaulting on kill TERM when logfile is set to 'syslog' in the configuration. Please find a patch below. Another point: Should stdout stay open on daemonize when logging to syslog ??

ulogd.c 2011-03-24 15:48:37.000000000 +0100 renamed from ulogd.c.orig 2011-03-24 15:45:34.000000000 +0100 +2 -2
@@ -1047,7 +1047,7 @@
        unload_plugins();
 #endif
 
-       if (logfile != NULL  && logfile != stdout) {
+       if (logfile != NULL  && logfile != stdout && logfile != &syslog_dummy ) {
                fclose(logfile);
                logfile = NULL;
        }
@@ -1228,7 +1228,7 @@
                if (fork()) {
                        exit(0);
                }
-               if (logfile != stdout && logfile != &syslog_dummy)
+               if (logfile != stdout )
                        fclose(stdout);
                fclose(stderr);
                fclose(stdin);

Cheers,

-salih

#1 lore raw
Quoted 4 lines · Salih Gönüllü

Hi,

ulogd is segfaulting on kill TERM when logfile is set to 'syslog' in the configuration. Please find a patch below.

I have applied the following patch.

http://git.netfilter.org/cgi-bin/gitweb.cgi?p=ulogd2.git;a=commit;h=c8fb552eeabd1a7cd9440d55c96918c0aa1ae3a9

Quoted 2 lines

Another point: Should stdout
stay open on daemonize when logging to syslog ??

this does make too much sense indeed.

Please, include a short description in your patches and add the Signed-off-by tag. This makes easier to apply it with git-am.

Thanks Salih!