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

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

Can Emacs's bundled LDAP package deal with ldaps:// URLs?


From: Sean McAfee
Subject: Can Emacs's bundled LDAP package deal with ldaps:// URLs?
Date: Fri, 03 Dec 2010 12:39:55 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

As best I can tell the answer is "No," but I'm hoping someone might be
able to point out something I missed...

My company provides an LDAP server accessed via an ldaps:// URL.  From
experimenting with the ldapsearch program on the command line, the only
way I can access the server is to specify the URL using the -H flag.
Browsing Emacs's bundled ldap.el file, it appears that it cannot supply
that flag in its call out to ldapsearch.

My klugy solution has been to use the ldaps URL as my LDAP "host," and
then sneakily change the -h flag to -H thusly:

(defadvice call-process (before ldapsearch-fix activate disable)
  (loop for arg in args
        if (string-match "^-h" arg)
        do (store-substring arg 1 ?H)
        and return nil))

(defadvice ldap-search (around ldapsearch-fix activate)
  (ad-enable-advice 'call-process 'before 'ldapsearch-fix)
  (ad-activate 'call-process)
  ad-do-it
  (ad-disable-advice 'call-process 'before 'ldapsearch-fix)
  (ad-activate 'call-process))

Is there any better way using the basic functionality, or should I
report a bug/submit a patch?


reply via email to

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