[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#12724: closed (ldap.el Problem and Solution)

From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#12724: closed (ldap.el Problem and Solution)
Date: Thu, 25 Oct 2012 12:44:02 +0000

Your message dated Thu, 25 Oct 2012 08:41:43 -0400
with message-id <address@hidden>
and subject line Re: bug#12724: ldap.el Problem and Solution
has caused the debbugs.gnu.org bug report #12724,
regarding ldap.el Problem and Solution
to be marked as done.

(If you believe you have received this mail in error, please contact

12724: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12724
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: ldap.el Problem and Solution Date: Wed, 24 Oct 2012 14:33:06 -0400 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux)

I recently hit a problem in which ldap-search (in ldap.el) would
return a list of records where the first record would always be nil.
As far as I can tell, the rest of the list was correct; it just had an
extra nil in the beginning.

After some debugging, I think the issue is that my ldapsearch program
(from OpenLDAP) doesn't quite use the output format ldap.el expects.
The expected format is

dn: ..........
<attribute>: <value>
<attribute>: <value>
.... more attributes here ......

This is the ldif format, which seems to be standardized. But
tragically, my ldapsearch program prints a header, which makes the
results look like this:

version: 1

dn: .........
<attribute>: <value>
.... more attributes .....

This confuses the ldap.el parsing. I can tell this is the problem
because when I step through in the debugger, the "dn" variable is set
to "version: 1", instead of the obviously correct value. Then when it
attempts to parse its results it finds an empty record, and so pushes
'nil onto its results list, which is what causes the problem.

The solution is to insert this after line 579 of ldap.el:

(if (looking-at "version:")
    (forward-line 1))

I have tested this, and it seems to work for me.

The other option is to make the ldapsearch program not print its
version header, but looking at its man page, I don't see a way to do

If this solution doesn't seem good, I am happy to try a different
approach, but it seems like the easiest solution to me. I have already
signed copyright papers, although for a change as small as this they
might not even be needed.

Noah Lavine

--- End Message ---
--- Begin Message --- Subject: Re: bug#12724: ldap.el Problem and Solution Date: Thu, 25 Oct 2012 08:41:43 -0400 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux)
> Yes, that works.

Thank you, installed,


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]