[PATCH 1/10] Debian patch: Make sure nmbd still responds to SIGTERM if it has no interfaces to listen on

Steve Langasek vorlon at debian.org
Wed May 30 21:06:46 GMT 2007


On Wed, May 30, 2007 at 09:57:16PM +0200, Christian Perrier wrote:
> The attached patch is currently used in Debian.

> >From what I can understand, it was meant to fix our #168079 bug: 
> http://bugs.debian.org/168079.

> In indeed have no clue whether the reported behaviour still happens
> with 3.0.2x a the issue was reported against pre-3.0 versions..:-)

Looks pretty clear to me that it's still an issue, since it still applies
cleanly and this is the right scope where the signal handler *should* be
restored...

-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
vorlon at debian.org                                   http://www.debian.org/


> Goal: Make sure nmbd still responds to SIGTERM if it has no interfaces to
>       listen on
> 
> Fixes: #168079
> 
> Status wrt upstream: No apparent reason for not being forwarded upstream
> 
> Author: Stave Langasek <vorlon at debian.org>
> 
> Note: To be confirmed by Steve
> 
> Index: samba-3.0.25a/source/nmbd/nmbd_subnetdb.c
> ===================================================================
> --- samba-3.0.25a.orig/source/nmbd/nmbd_subnetdb.c	2007-05-26 07:45:40.136219349 +0200
> +++ samba-3.0.25a/source/nmbd/nmbd_subnetdb.c	2007-05-26 07:46:31.104625382 +0200
> @@ -185,12 +185,16 @@
>  	struct in_addr unicast_ip, ipzero;
>  
>  	if(num_interfaces == 0) {
> +		void (*old_handler)(int);
> +
>  		DEBUG(0,("create_subnets: No local interfaces !\n"));
>  		DEBUG(0,("create_subnets: Waiting for an interface to appear ...\n"));
> +		old_handler = CatchSignal( SIGTERM, SIGNAL_CAST SIG_DFL );
>  		while (iface_count() == 0) {
>  			sleep(5);
>  			load_interfaces();
>  		}
> +		CatchSignal( SIGTERM, SIGNAL_CAST old_handler );
>  	}
>  
>  	num_interfaces = iface_count();



More information about the samba-technical mailing list