From cf3b24b2ea79c262c7827a954da9105a21b2c7d7 Mon Sep 17 00:00:00 2001 From: Alan Hicks Date: Fri, 14 Oct 2016 13:59:56 +0100 Subject: [PATCH 18/33] Add definition for authldap_free --- src/modules/authldap.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git src/modules/authldap.c src/modules/authldap.c index 2bf3b95..065ee31 100644 --- src/modules/authldap.c +++ src/modules/authldap.c @@ -28,22 +28,7 @@ extern char configFile[PATH_MAX]; -/* - signal-safe releasing of thread-local ldap connection -*/ -static void authldap_free(gpointer data) -{ - LDAP *c = (LDAP *)data; - struct sigaction act, oldact; - - memset(&act, 0, sizeof(act)); - memset(&oldact, 0, sizeof(oldact)); - act.sa_handler = SIG_IGN; - sigaction(SIGPIPE, &act, &oldact); - ldap_unbind(c); - sigaction(SIGPIPE, &oldact, 0); -} - +static void authldap_free(gpointer data); static GPrivate ldap_conn_key = G_PRIVATE_INIT (authldap_free); static GOnce ldap_conn_once = G_ONCE_INIT; static int authldap_connect(void); @@ -177,6 +162,22 @@ static LDAP * ldap_con_get(void) } /* + signal-safe releasing of thread-local ldap connection +*/ +static void authldap_free(gpointer data) +{ + LDAP *c = (LDAP *)data; + struct sigaction act, oldact; + + memset(&act, 0, sizeof(act)); + memset(&oldact, 0, sizeof(oldact)); + act.sa_handler = SIG_IGN; + sigaction(SIGPIPE, &act, &oldact); + ldap_unbind(c); + sigaction(SIGPIPE, &oldact, 0); +} + +/* * auth_ldap_bind() * * Bind to server using config credentials -- 2.10.1 (Apple Git-78)