]> code.delx.au - gnu-emacs/blobdiff - lisp/net/ldap.el
Update copyright year to 2015
[gnu-emacs] / lisp / net / ldap.el
index 2caf8dec30f6dc104815465f471f4107ea274c48..eb1b7589b486c8cb73d771f62b9e2d1084a2087c 100644 (file)
@@ -1,9 +1,9 @@
 ;;; ldap.el --- client interface to LDAP for Emacs
 
-;; Copyright (C) 1998-201 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2015 Free Software Foundation, Inc.
 
 ;; Author: Oscar Figueiredo <oscar@cpe.fr>
-;; Maintainer: FSF
+;; Maintainer: emacs-devel@gnu.org
 ;; Created: April 1998
 ;; Keywords: comm
 
@@ -34,7 +34,6 @@
 ;;; Code:
 
 (require 'custom)
-(eval-when-compile (require 'cl))
 
 (autoload 'auth-source-search "auth-source")
 
@@ -465,12 +464,12 @@ Additional search parameters can be specified through
       (error "No LDAP host specified"))
   (let ((host-plist (cdr (assoc host ldap-host-parameters-alist)))
        result)
-    (setq result (ldap-search-internal (list* 'host host
-                                             'filter filter
-                                             'attributes attributes
-                                             'attrsonly attrsonly
-                                             'withdn withdn
-                                             host-plist)))
+    (setq result (ldap-search-internal `(host ,host
+                                        filter ,filter
+                                         attributes ,attributes
+                                         attrsonly ,attrsonly
+                                         withdn ,withdn
+                                         ,@host-plist)))
     (if ldap-ignore-attribute-codings
        result
       (mapcar (lambda (record)
@@ -498,7 +497,7 @@ but if you have more than one in your netrc file, only the first
 matching one will be used.  Note the \"port ldap\" part is NOT
 required.
 
-  `host' is a string naming one or more (blank-separated) LDAP servers to
+  `host' is a string naming one or more (blank-separated) LDAP servers
 to try to connect to.  Each host name may optionally be of the form HOST:PORT.
   `filter' is a filter string for the search as described in RFC 1558.
   `attributes' is a list of strings indicating which attributes to retrieve
@@ -605,6 +604,7 @@ an alist of attribute/value pairs."
        ;; Skip error message when retrieving attribute list
        (if (looking-at "Size limit exceeded")
            (forward-line 1))
+        (if (looking-at "version:") (forward-line 1)) ;bug#12724.
        (while (progn
                 (skip-chars-forward " \t\n")
                 (not (eobp)))
@@ -632,9 +632,10 @@ an alist of attribute/value pairs."
            (setq record (cons (list name value)
                               record))
            (forward-line 1))
-         (push (if withdn
-                   (cons dn (nreverse record))
-                 (nreverse record)) result)
+         (cond (withdn
+                (push (cons dn (nreverse record)) result))
+               (record
+                (push (nreverse record) result)))
          (setq record nil)
          (skip-chars-forward " \t\n")
          (message "Parsing results... %d" numres)