From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thomas Fitzsimmons Newsgroups: gmane.emacs.devel Subject: Re: ldap support: eudc and ldap.el Date: Tue, 10 Dec 2013 09:08:07 -0500 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1386684520 7405 80.91.229.3 (10 Dec 2013 14:08:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 10 Dec 2013 14:08:40 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 10 15:08:45 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VqNzO-0005gY-Tz for ged-emacs-devel@m.gmane.org; Tue, 10 Dec 2013 15:08:43 +0100 Original-Received: from localhost ([::1]:49300 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqNzO-0000CT-EU for ged-emacs-devel@m.gmane.org; Tue, 10 Dec 2013 09:08:42 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39476) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqNzG-0000CH-D0 for emacs-devel@gnu.org; Tue, 10 Dec 2013 09:08:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VqNzA-0006Pv-RS for emacs-devel@gnu.org; Tue, 10 Dec 2013 09:08:34 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:52511) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqNzA-0006Pp-Kd for emacs-devel@gnu.org; Tue, 10 Dec 2013 09:08:28 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VqNz8-0005Vp-TL for emacs-devel@gnu.org; Tue, 10 Dec 2013 15:08:26 +0100 Original-Received: from 69.157.67.117 ([69.157.67.117]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 10 Dec 2013 15:08:26 +0100 Original-Received: from fitzsim by 69.157.67.117 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 10 Dec 2013 15:08:26 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 44 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 69.157.67.117 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:bqzphZaAJVysCb50nvz9zQDAv+E= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:166258 Archived-At: Stefan Monnier 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