unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Thomas Fitzsimmons <fitzsim@fitzsim.org>
To: emacs-devel@gnu.org
Subject: Re: ldap support: eudc and ldap.el
Date: Tue, 10 Dec 2013 09:08:07 -0500	[thread overview]
Message-ID: <m3siu0u7co.fsf@fitzsim.org> (raw)
In-Reply-To: jwvhaapvmu5.fsf-monnier+emacs@gnu.org

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> I've got it working to my satisfaction now, but I consider most of the
>> changes I made hacks.  It would definitely be nice to see EUDC/ldap.el
>> modernized.
>
> Patches welcome.  You could post your hacks as patches included in
> a bug-report.  Even if it's not "good enough", it can be very useful
> since someone else may be able to improve/clean it.

OK, I'm readying my patches for submission.  One area where I could use
some guidance is how to improve ldap.el's interaction with the
ldapsearch process.

Currently the password is passed as a command-line argument:

(defun ldap-search-internal (search-plist)
[...]
      (if (and passwd
	       (not (equal "" passwd)))
	  (setq arglist (nconc arglist (list (format "-w%s" passwd)))))
[...]
      (apply #'call-process ldap-ldapsearch-prog
	     ;; Ignore stderr, which can corrupt results
	     nil (list buf nil) nil
	     (append arglist ldap-ldapsearch-args filter))

which means it can be seen in clear text in the process list by other
users on the system.

ldapsearch provides a -W option to prompt for the password and receive
it on stdin, so I'm trying to use that instead.  I hacked an
implementation using a sentinel, but it's too simplistic (it does a
timed wait instead of watching for the prompt).

The steps are: 1) run the process, 2) wait for the "Enter LDAP
Password:" prompt, 3) send the contents of the passwd variable to the
process's stdin.

Can you recommend an approach to implementing those steps?  Should I do
a full process-filter-based implementation or is there a simpler way?

Thanks,
Thomas




  parent reply	other threads:[~2013-12-10 14:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-03 16:46 ldap support: eudc and ldap.el T.V. Raman
2013-12-03 17:23 ` Thomas Fitzsimmons
2013-12-03 17:59   ` Stefan Monnier
2013-12-04  1:38     ` T.V. Raman
2013-12-10 14:08     ` Thomas Fitzsimmons [this message]
2014-01-02  2:17     ` Thomas Fitzsimmons

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=m3siu0u7co.fsf@fitzsim.org \
    --to=fitzsim@fitzsim.org \
    --cc=emacs-devel@gnu.org \
    /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).