Package: emacs21-common
Version: 21.4a-3
Severity: normal
Tags: patch

ldap.el's ldap-search-internal function invokes the ldapsearch command
with a "-t" option and expects /all/ values to be written to
temp-files, but "-t" diverts only values containing /unprintable/
characters to temp-files. Many values are included literally in the
ldapsearch output, and ldap.el mistakenly treats these values as the
names of temp-files to open, and just fails.

Here's a patch:

--- ldap.el.distrib	2001-12-28 01:28:32.000000000 -0500
+++ ldap.el	2006-08-04 14:53:00.000000000 -0400
@@ -528,7 +528,7 @@
 	(sizelimit (plist-get search-plist 'sizelimit))
 	(withdn (plist-get search-plist 'withdn))
 	(numres 0)
-	arglist dn name value record result)
+	arglist dn name value value-file record result)
     (if (or (null filter)
 	    (equal "" filter))
 	(error "No search filter"))
@@ -586,13 +586,15 @@
 	  (forward-line 1)
 	  (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))))
+		  value (match-string 3)
+		  value-file (match-string 2))
+	    (when value-file
+	      (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))
-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.16-2-686-smp
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages emacs21-common depends on:
ii  dpkg                          1.13.21    package maintenance system for Deb
ii  emacsen-common                1.4.17     Common facilities for all emacsen

emacs21-common recommends no packages.

-- no debconf information

Reply via email to