Subject: bug#58605: 29.0.50; Commit 2a2f5530fa2 breaks ldap-search-internal

From: Jens Lechtenboerger <[email-masked]>
Date: Sat, 22 Oct 2022 11:43:07 +0200

Hi there!

On 2022-10-21, Filipp Gunbin wrote:

> Oh, so this is not just a test case, but the code you actually use.  Add
> "-LLL" to ldap-ldapsearch-args?

This was a test case.  In my code [1], I use ldap-search, not the
internal function.  Essentially, like this:

(let ((ldap-default-base "O=DFN-Verein,C=DE")
      (ldap-ldapsearch-args '("-x" "-tt" "-H ldaps://ldap.pca.dfn.de"))
      (mail "[email-masked]")
      (host ""))
  (ldap-search (concat "mail=" mail) host '("userCertificate") nil))

Previously, this just returned the userCertificate, with and without
-LLL.  If no certificate existed, it returned nil.

Now, -LLL seems to be required, which I perceive to be a breaking
change.  Can this be avoided?  Alternatively, document it?

I confirm that with -LLL, my code works.

Without it, I get ((("search" " ") ("result" " "))) instead of nil.

Also, without -LLL and with an existing certificate, ("dn" " ") and
(("search" " ") ("result" " ")) are included in the result.  Note
that I find ("dn" " ") misleading, as ldapsearch really does return
a dn value...

> BTW, that question mark in the regexp was added to fix M-x
> eudc-get-attribute-list, which was broken.

I was not aware of eudc, thanks!

Best wishes
Jens

[1] https://gitlab.com/lechten/defaultencrypt/-/blob/master/jl-smime.el