[exim-dev] [Bug 1521] list separator missing for multiple va…

Góra strony
Delete this message
Reply to this message
Autor: Git Commit
Data:  
Dla: exim-dev
Temat: [exim-dev] [Bug 1521] list separator missing for multiple values returned from ldap (fix included)
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=1521

Git Commit <git@???> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |git@???





--- Comment #10 from Git Commit <git@???> 2014-09-11 23:17:07 ---
Git commit:
http://git.exim.org/exim.git/commitdiff/6f5d1ca3b1563d0ed580a43ba711b3534b19234e

commit 6f5d1ca3b1563d0ed580a43ba711b3534b19234e
Author:     Heiko Schlittermann <hs+exim@???>
AuthorDate: Thu Sep 11 22:25:51 2014 +0100
Commit:     Jeremy Harris <jgh146exb@???>
CommitDate: Thu Sep 11 22:40:50 2014 +0100


    Fix ldap lookup for single-attr request, multiple-attr return. Bug 1521


    Exim documented behaviour is that the single-request case controls
    the output format (by not labelling attributes with names).
    The code is broken for the case where attrs B, C are derived from A
    and A is requested (and the LDAP server used isn't buggy here; some
    are and only return A rather than A, B, C).
---
 src/src/lookups/ldap.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)


diff --git a/src/src/lookups/ldap.c b/src/src/lookups/ldap.c
index f77229d..ef7ed9e 100644
--- a/src/src/lookups/ldap.c
+++ b/src/src/lookups/ldap.c
@@ -797,7 +797,13 @@ while ((rc = ldap_result(lcp->ld, msgid, 0, timeoutptr,
&result)) ==

             DEBUG(D_lookup) debug_printf("LDAP attr loop %s:%s\n", attr,
value);


-            if (values != firstval)
+           /* In case we requested one attribute only but got
+            * several times into that attr loop, we need to append
+            * the additional values. (This may happen if you derive 
+            * attributeTypes B and C from A and then query for A.)
+            * In all other cases we detect the different attribute
+            * and append only every non first value. */
+           if ((attr_count == 1 && data) || (values != firstval))
               data = string_cat(data, &size, &ptr, US",", 1);


             /* For multiple attributes, the data is in quotes. We must escape



--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email