help-emacs-windows
[Top][All Lists]
Advanced

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

[h-e-w] Small patch against ldap.el


From: Andreas Ames
Subject: [h-e-w] Small patch against ldap.el
Date: 17 Jun 2002 17:47:59 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Hi all,

I'm using emacs 21.2 on w2k and I'm relying on ldap.el to access our
Exchange address book (via eudc).  I had problems to get it to work
with 'ldapsearch.exe' from openldap (version 2.x; sorry I've removed
the source tree so I can't seem to remember the exact version info;
it's a rather recent version; I've built it under cygwin).  I remember
that I had similar problems with ldap.el shipped with emacs 21.1.

The only way around these problems that I found was a small patch
against the elisp source of ldap.el.  I thought it could be useful for
others and that the release version can be fixed some day.  Note that
I'm no elisp guru at all; please be careful with that code.

You have to customize the variable 'ldap-ldapsearch-args' because the
'ldapsearch.exe' from openldap doesn't support the preset '-B'
commandline switch (and it doesn't support the switch '-T' which is
proposed in the docstring).  I use '-LLL' here.  Be sure *not* to use
(or at least to read carefully the source of 'ldap-search-internal' in
ldap.el before using) the commandline switch '-F' of 'ldapsearch.exe'.
ldap.el essentially depends on the prefix beginning with the string
'file://'.  I'm sure one could write the according elisp code to
handle this switch but it's not worth it for my purposes.

After that you can apply the attached patch.  It tries to fix two
problems I found in the original code:

1) The shipped code seems to depend on the assumption that *all*
   attribute values are written to temporary files.  This is not the
   case for openldap's ldap-client.  The hardcoded '-t' commandline
   switch only outputs binary attribute values to temporary files.
   ASCII attribute values are still inlined.  Changing the '-t' switch
   to '-tt' (writing all attribute values to temporary files) implies
   a considerable performance penalty.

2) The shipped code doesn't handle continuation lines in the
   ldap-client's output.  At least openldap's client breaks output
   lines that are longer than approx. 80 characters and writes the
   rest of the output line to the next line which is indented by a
   single space character.  The patch also accepts indentation by
   multiple spaces and tabs and combinations thereof.  Please note
   that I've only inferred this format of continuation lines from
   examples.  I didn't even try to find documentation for it (so my
   assumptions may well be wrong).  It seems to work for me.


Cheers,

Andreas Ames



Attachment: ldap.el.patch
Description: Patch against ldap.el to suit openldap's ldapsearch.exe


reply via email to

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