GNU bug report logs -
#12724
ldap.el Problem and Solution
Previous Next
Reported by: Noah Lavine <noah.b.lavine <at> gmail.com>
Date: Wed, 24 Oct 2012 18:36:02 UTC
Severity: normal
Done: Stefan Monnier <monnier <at> iro.umontreal.ca>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 12724 in the body.
You can then email your comments to 12724 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#12724
; Package
emacs
.
(Wed, 24 Oct 2012 18:36:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Noah Lavine <noah.b.lavine <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Wed, 24 Oct 2012 18:36:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Hello,
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
that.
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.
Thanks,
Noah Lavine
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#12724
; Package
emacs
.
(Wed, 24 Oct 2012 20:43:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 12724 <at> debbugs.gnu.org (full text, mbox):
> (if (looking-at "version:")
> (forward-line 1))
Can you confirm the patch below works?
Stefan
=== modified file 'lisp/net/ldap.el'
--- lisp/net/ldap.el 2012-07-11 23:13:41 +0000
+++ lisp/net/ldap.el 2012-10-24 20:39:11 +0000
@@ -604,6 +604,7 @@
;; Skip error message when retrieving attribute list
(if (looking-at "Size limit exceeded")
(forward-line 1))
+ (if (looking-at "version:") (forward-line 1)) ;bug#12724.
(while (progn
(skip-chars-forward " \t\n")
(not (eobp)))
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#12724
; Package
emacs
.
(Wed, 24 Oct 2012 21:45:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 12724 <at> debbugs.gnu.org (full text, mbox):
Yes, that works.
Thanks a lot for such a quick response,
Noah
On Wed, Oct 24, 2012 at 4:39 PM, Stefan Monnier
<monnier <at> iro.umontreal.ca> wrote:
>> (if (looking-at "version:")
>> (forward-line 1))
>
> Can you confirm the patch below works?
>
>
> Stefan
>
>
> === modified file 'lisp/net/ldap.el'
> --- lisp/net/ldap.el 2012-07-11 23:13:41 +0000
> +++ lisp/net/ldap.el 2012-10-24 20:39:11 +0000
> @@ -604,6 +604,7 @@
> ;; Skip error message when retrieving attribute list
> (if (looking-at "Size limit exceeded")
> (forward-line 1))
> + (if (looking-at "version:") (forward-line 1)) ;bug#12724.
> (while (progn
> (skip-chars-forward " \t\n")
> (not (eobp)))
>
Reply sent
to
Stefan Monnier <monnier <at> iro.umontreal.ca>
:
You have taken responsibility.
(Thu, 25 Oct 2012 12:44:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Noah Lavine <noah.b.lavine <at> gmail.com>
:
bug acknowledged by developer.
(Thu, 25 Oct 2012 12:44:02 GMT)
Full text and
rfc822 format available.
Message #16 received at 12724-done <at> debbugs.gnu.org (full text, mbox):
> Yes, that works.
Thank you, installed,
Stefan
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Fri, 23 Nov 2012 12:24:03 GMT)
Full text and
rfc822 format available.
This bug report was last modified 12 years and 207 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.