[syslog-ng] syslog-ng.ctl socket fd leak in 3.3.3

Balazs Scheidler bazsi at balabit.hu
Mon Jan 16 22:50:27 CET 2012


On Wed, 2012-01-11 at 13:45 +0100, Peter Eisenlohr wrote:
> Hi,
> 
> the following patch fixes the problem for me. Not sure if this is the
> right place for the close(), though.
> 
>    Peter
> 
> --- ../syslog-ng-3.3.3.orig/lib/control.c       2011-04-30
> 23:04:19.000000000 +0200
> +++ lib/control.c       2012-01-11 13:41:56.000000000 +0100
> @@ -244,8 +244,8 @@
>    return;
>   destroy_connection:
>    control_connection_stop_watches(self);
> +  close(self->control_io.fd);
>    control_connection_free(self);
> -
>  }
> 
>  static void
> 

Good catch. This close() probably went MIA when converting the code to
ivykis.

The patch below moves the close() call to the destructor function. Can
you try if it works the same for you?

Thanks.

commit 3dc36259904aa1b206ee52e6ac2cd1266957cef0
Author: Balazs Scheidler <bazsi at balabit.hu>
Date:   Mon Jan 16 22:49:01 2012 +0100

    control socket: close connection fd to avoid leak
    
    This patch fixes an fd leak associated with control connections, that
    are used by syslog-ng-ctl.
    
    Reported-By: Jakub Jankowski <shasta at toxcorp.com>
    Fixed-By: Peter Eisenlohr <peter.eisenlohr at inform-software.com>
    Signed-off-by: Balazs Scheidler <bazsi at balabit.hu>

-- 
Bazsi




More information about the syslog-ng mailing list