Package: ucarp
Version: 1.5-2
Severity: normal
Tags: patch

ucarp is still a session leader after the daemonize function. Also when an 
instance 
receives a HUP - signal it just exits without calling a shutdown script, which 
could 
lead to a interface being up on both master + slave (at least for testing 
purposes).

-- System Information:
Debian Release: 5.0.4
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-2-686 (SMP w/1 CPU core)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages ucarp depends on:
ii  libc6                       2.7-18lenny2 GNU C Library: Shared libraries
ii  libpcap0.8                  0.9.8-5      system interface for user-level pa

Versions of packages ucarp recommends:
ii  iproute                       20080725-2 networking and traffic control too

ucarp suggests no packages.

-- no debconf information
diff -rup /usr/src/ucarp-1.5/src/carp.c /usr/src/ucarp-1.5-jk/src/carp.c
--- /usr/src/ucarp-1.5/src/carp.c	2010-03-17 17:40:42.000000000 +0100
+++ /usr/src/ucarp-1.5-jk/src/carp.c	2010-03-16 23:21:24.000000000 +0100
@@ -740,6 +740,7 @@ int docarp(void)
     
     if (shutdown_at_exit != 0) {
         (void) signal(SIGINT, sighandler_exit);
+        (void) signal(SIGHUP, sighandler_exit);
         (void) signal(SIGQUIT, sighandler_exit);
         (void) signal(SIGTERM, sighandler_exit);
     }
diff -rup /usr/src/ucarp-1.5/src/daemonize.c /usr/src/ucarp-1.5-jk/src/daemonize.c
--- /usr/src/ucarp-1.5/src/daemonize.c	2007-07-04 15:34:59.000000000 +0200
+++ /usr/src/ucarp-1.5-jk/src/daemonize.c	2010-03-17 17:21:50.000000000 +0100
@@ -61,6 +61,20 @@ void dodaemonize(void)
                     _("Unable to detach from the current session: %s"),
                     strerror(errno));  /* continue anyway */
         }
+
+	/* Dont be session leader */
+	switch( child = fork() ) {
+		case -1:
+			_exit(EXIT_FAILURE);
+			break;
+		case 0:
+			break;
+		default:
+			_exit( EXIT_SUCCESS );
+		break;
+	}
+	
+
         chdir("/");
         i = open_max();        
         do {

Reply via email to