From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Martin Morgan Newsgroups: gmane.emacs.help Subject: Re: Does anybody have EUDC and OpenLDAP working? Date: 16 Jan 2004 10:41:38 -0800 Organization: Washington State University Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <874qux5m2a.fsf@drdc-rddc.gc.ca> <87zncoux58.fsf@dimail.umc.com.ua> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1074280252 7738 80.91.224.253 (16 Jan 2004 19:10:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 16 Jan 2004 19:10:52 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jan 16 20:10:38 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AhZMb-0001zd-00 for ; Fri, 16 Jan 2004 20:10:37 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AhZJs-0001In-9F for geh-help-gnu-emacs@m.gmane.org; Fri, 16 Jan 2004 14:07:48 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!canoe.uoregon.edu!news.wa-k20.net!news.wsu.edu!not-for-mail Original-Newsgroups: gnu.emacs.gnus,gnu.emacs.help Original-Followup-To: gnu.emacs.help Original-Lines: 86 Original-NNTP-Posting-Host: s20033014.temp.wsu.edu Original-X-Trace: murrow.it.wsu.edu 1074278513 433346 134.121.33.14 (16 Jan 2004 18:41:53 GMT) Original-X-Complaints-To: abuse@wsu.edu Original-NNTP-Posting-Date: Fri, 16 Jan 2004 18:41:53 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 Original-Xref: shelby.stanford.edu gnu.emacs.gnus:69596 gnu.emacs.help:120164 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:16107 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:16107 > Bruce.Skinner@drdc-rddc.gc.ca (Bruce S. Skinner) 14:22 15/1/2004 wrote: > > BSS> When doing a directory search I get the error: > > BSS> Opening input file: no such file or directory, > BSS> /home/skinner/unrecognized option -B > > BSS> My environment is Emacs v21.2.1, OpenLDAP 2.1.22 I've just been struggling with this. I think there are two things. First, the variable ldap-host-parameters-alist has a default option -B, but I think openldap doesn't recognize this option. So use customize-variable ldap-host-parameters-alist and delete this. Second and more problematic is in the ldap.el file. The function ldap-search-internal parses the info that comes back from ldapsearch with this snippet: (while (looking-at "^\\(\\w*\\)[=:\t ]+\\(<[\t ]*file://\\)?\\(.*\\)$") (setq name (match-string 1) value (match-string 3)) (save-excursion (set-buffer bufval) (erase-buffer) (insert-file-contents-literally value) (delete-file value) (setq value (buffer-substring (point-min) (point-max)))) (setq record (cons (list name value) record)) (forward-line 1)) although written otherwise, the regexp is designed for ldapsearch storing each search key in a temporary file (with OpenLDAP this would be accomplished by the variable -tt), and the search itself returning a list of keys and the file they're stored in. The regexp extracts the file tag and file name, and then, in the save-excursion retrieves the info from the file. What actually happens with the default arguments is that the keys are not saved to file, but are returned as key: value pairs. The regexp picks up the value, but the value is treated as a file name. Here's my kludge: (while (looking-at "^\\(\\w*\\)[=:\t ]+\\(<[\t ]*file://\\)?\\(.*\\)$") (setq name (match-string 1) file (match-string 2) ; mtm -- only match with binary files value (match-string 3)) (if file ; mtm -- read any binary files (save-excursion (set-buffer bufval) (erase-buffer) (insert-file-contents-literally value) (delete-file value) (setq value (buffer-substring (point-min) (point-max)))) ) ; mtm -- end if Basically, only replace the value with file contents when a value is actually returned in a file (apparently, this can happen with the -t option if, for instance, the LDAP server stores, e.g., pictures of each entry). It's not enough just to feed -tt as an option in ldap-host-parameters-alist (which would be overkill anyway, storing all values in temporary files) because earlier in the ldap-search-internal routine there's an assumption about the format of the output (that the first line after blank is dn: value) that isn't true for the default ldapsearch parameters (where the first line after a blank is a comment). I *think* the non-coding solution is to customize the ldap-host-parameters-alist to -LLL and -tt. If you go with this option, you might need to make ensure file naming conventions so that OpenLDAP deals with spaces in file names correctly. Hope that helps! Dmitry Astapov writes: > Evening, Bruce. > > > Lucky you. I (with xemacs 21.4.14 and openldap 2.1.23) often get my xemacs > crashed on the first (after reboot) eudc search. It goes on for quite a > long time and I honestly dont know what to do about it ... This, unfortunately, I cannot help with.