ports/mail/dbmail/files/patch-0025-Update-to-ldap_unbind_ext_s-and-remove-redundant-sigaction
Muhammad Moinur Rahman 9eff14e488 mail/dbmail: adopt latest fixes from git:
- login_disabled option before starttls for pop3
- fix compiler warnings for GCC5
- Fix IMAP mailbox maintanence
- prevent assertion in p_string_erase
- improve crypt authentication, also don't segfault when spasswd is empty
- simplify log_query_time duration logic
- Disconnect IMAP clients if only few free FDs left
- Add primary key constraint to dbmail_authlog
- Rework temporary connection failures
- Give sensible default for retry 120s
- Add retries for binding and searching
- Bump search timeout to 60s
- Increase ldap timeout to 600s 10 mins
- Refactor deprecated functions
- Get timeout from config
- Remove redundant event_assign
- Remove deprecated non functioning g_mem_profile
- Add definition for authldap_free
- Revert inadvertent event_assign removal
- Reduce failed LDAP connection for search to error
- Update LDAP to non deprecated search
- Clear the ldap connection
- Update ldap deprecated unbind
- Fix typo
- Update to ldap_unbind_ext_s and remove redundant sigaction
- Rebalance commit rollback
- Ensure mailbox2dbmail is using Python 2
- Tidy mailbox2dbmail man page
- Update description of pid file location in server man page
- Boundaries fixups ordering of parts do not add newline on
- Prepend headers during delivery
- Allow for systems that don't use proc

PR:		210274
Submitted by:	fluffy
2017-02-24 21:15:52 +00:00

50 lines
1.4 KiB
Text

From 53ca6f11530a73838d73d3064f4b3d48e477f614 Mon Sep 17 00:00:00 2001
From: Alan Hicks <ahicks@p-o.co.uk>
Date: Fri, 28 Oct 2016 16:38:20 +0100
Subject: [PATCH 25/33] Update to ldap_unbind_ext_s and remove redundant
sigaction
---
src/modules/authldap.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git src/modules/authldap.c src/modules/authldap.c
index 2180ed0..05c3331 100644
--- src/modules/authldap.c
+++ src/modules/authldap.c
@@ -167,14 +167,15 @@ static LDAP * ldap_con_get(void)
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_ext(c, NULL, NULL);
- sigaction(SIGPIPE, &oldact, 0);
+
+ int err = ldap_set_option(c, LDAP_OPT_SERVER_CONTROLS, NULL );
+ if ( err != LDAP_OPT_SUCCESS ) {
+ TRACE(TRACE_ERR, "Could not unset controls");
+ }
+
+ if ((err = ldap_unbind_ext_s(c, NULL, NULL))) {
+ TRACE(TRACE_ERR, "ldap_unbind_ext_s failed: %s", ldap_err2string(err));
+ }
}
/*
@@ -639,7 +640,7 @@ int auth_connect(void)
int auth_disconnect(void)
{
// Just free the pointer,
- // G_PRIVATE_INIT calls GDestroyNotify
+ // G_PRIVATE_INIT calls GDestroyNotify
// which calls authldap_free()
g_private_replace(&ldap_conn_key, NULL);
return 0;
--
2.10.1 (Apple Git-78)