unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Filipp Gunbin <fgunbin@fastmail.fm>
To: Jens Lechtenboerger <lechten@wi.uni-muenster.de>
Cc: 58605@debbugs.gnu.org, Juri Linkov <juri@linkov.net>
Subject: bug#58605: 29.0.50; Commit 2a2f5530fa2 breaks ldap-search-internal
Date: Mon, 24 Oct 2022 19:06:37 +0300	[thread overview]
Message-ID: <m2ilk9cik2.fsf@fastmail.fm> (raw)
In-Reply-To: <874jvwp51w.fsf@wi.uni-muenster.de> (Jens Lechtenboerger's message of "Sat, 22 Oct 2022 11:43:07 +0200")

Hi Jens,

On 22/10/2022 11:43 +0200, Jens Lechtenboerger wrote:

> 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 "nix@example.org")
>       (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.

But ldap-search expects ldap-ldapsearch-args to be at least what default
value is, to be able to parse the output (btw, "-LL" was there since
"forever", which is 20 years in this case; it's just the third L which
was added recently, to exclude ldif version from the output).  Also,
default value can change along with ldap-search internal changes.  So if
you want to let-bind it, you should merge in your additional args, not
replace them.

However, I don't see why you would want to let-bind it:

- -H: Why don't you use host parameter?
- -x: just pass 'auth = simple
- -tt: already in ldap-ldapsearch-args

Even more, I'd say that the user should set ldap-host-parameters-alist
according to his/her setup, and you should not mess with ldapsearch
arguments at all.  Like:

(setq ldap-host-parameters-alist
      '(("ldap://example.org"
         auth simple
         auth-source t)))

Then just invoke:

(ldap-search "mail=.." "ldap://example.org"  '("userCertificate"))

> 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...

Without -LL(L), the parsing code works incorrectly, and this case
"worked" before only by coincidence.

HTH,
Filipp





  reply	other threads:[~2022-10-24 16:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-18  6:05 bug#58605: 29.0.50; Commit 2a2f5530fa2 breaks ldap-search-internal Jens Lechtenboerger
2022-10-18 14:17 ` Eli Zaretskii
2022-10-20  8:12 ` Juri Linkov
2022-10-20 17:58   ` Filipp Gunbin
2022-10-21  6:25     ` Jens Lechtenboerger
2022-10-21 15:16       ` Filipp Gunbin
2022-10-22  9:43         ` Jens Lechtenboerger
2022-10-24 16:06           ` Filipp Gunbin [this message]
2022-10-25  5:55             ` Jens Lechtenboerger
2022-10-25 13:12               ` Filipp Gunbin
2022-10-25 13:42                 ` Jens Lechtenboerger
2022-10-25 15:07                   ` Filipp Gunbin
2022-10-26  6:07                     ` Jens Lechtenboerger
2022-10-26 13:20                       ` Filipp Gunbin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2ilk9cik2.fsf@fastmail.fm \
    --to=fgunbin@fastmail.fm \
    --cc=58605@debbugs.gnu.org \
    --cc=juri@linkov.net \
    --cc=lechten@wi.uni-muenster.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).