[exim-cvs] Fix ldapauth

Góra strony
Delete this message
Reply to this message
Autor: Exim Git Commits Mailing List
Data:  
Dla: exim-cvs
Temat: [exim-cvs] Fix ldapauth
Gitweb: https://git.exim.org/exim.git/commitdiff/221f7d1e232ed26b674325adcfd3e30e3e2cf857
Commit:     221f7d1e232ed26b674325adcfd3e30e3e2cf857
Parent:     419d8549aad98eb3438593873332661e6fb1845e
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Mon Aug 19 15:01:56 2024 +0100
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Mon Aug 19 16:30:18 2024 +0100


    Fix ldapauth


    Broken-by: 419d8549aad9
---
 src/src/expand.c       | 2 +-
 src/src/lookups/ldap.c | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)


diff --git a/src/src/expand.c b/src/src/expand.c
index d7b55831f..e17c21788 100644
--- a/src/src/expand.c
+++ b/src/src/expand.c
@@ -2807,7 +2807,7 @@ switch(cond_type = identify_operator(&s, &opname))
       int stype = search_findtype(US"ldapauth", 8), expand_setup = -1;
       void * handle = search_open(NULL, stype, 0, NULL, NULL);
       if (handle)
-    rc= search_find(handle, NULL, sub[0],
+    rc = search_find(handle, NULL, sub[0],
             -1, NULL, 0, 0, &expand_setup, NULL)
       ? OK : f.search_find_defer ? DEFER : FAIL;
       else
diff --git a/src/src/lookups/ldap.c b/src/src/lookups/ldap.c
index 8a142398e..bf1e63325 100644
--- a/src/src/lookups/ldap.c
+++ b/src/src/lookups/ldap.c
@@ -117,7 +117,7 @@ Arguments:
   search_type   SEARCH_LDAP_MULTIPLE allows values from multiple entries
                 SEARCH_LDAP_SINGLE allows values from one entry only
                 SEARCH_LDAP_DN gets the DN from one entry
-  res           set to point at the result (not used for ldapauth)
+  res           set to point at the result (ldapauth gets an empty string if OK)
   errmsg        set to point a message if result is not OK
   defer_break   set TRUE if no more servers to be tried after a DEFER
   user          user name for authentication, or NULL
@@ -611,6 +611,7 @@ if (  !lcp->bound
 if (search_type == SEARCH_LDAP_AUTH)
   {
   DEBUG(D_lookup) debug_printf_indent("Bind succeeded: ldapauth returns OK\n");
+  *res = US"";
   goto RETURN_OK;
   }


@@ -1614,7 +1615,7 @@ static lookup_info ldapauth_lookup_info = {
   .find = eldapauth_find,        /* find function */
   .close = NULL,            /* no close function */
   .tidy = eldap_tidy,            /* sic */    /* tidy function */
-  .quote = eldap_quote,            /* sic */    /* quoting function */
+  .quote = NULL,            /* NO quoting function */
   .version_report = NULL                           /* no version reporting (redundant) */
 };



--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-cvs.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-cvs-unsubscribe@???
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/