From c9ce15f52b61b55fa9655b81fb99ff7b5095001c Mon Sep 17 00:00:00 2001 From: Jens Schmidt Date: Sun, 18 Jun 2023 12:32:54 +0200 Subject: [PATCH 2/2] Do not process dn entry with `ldap-decode-attribute' Function `ldap-search' errors out with `wrong-type-argument listp' when called with WITHDN non-nil. * lisp/net/ldap.el (ldap-search): Do not process first element of RECORD with `ldap-decode-attribute' if WITHDN is non-nil. (Bug#64089) --- lisp/net/ldap.el | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/lisp/net/ldap.el b/lisp/net/ldap.el index 78405414a28..1269db908d7 100644 --- a/lisp/net/ldap.el +++ b/lisp/net/ldap.el @@ -484,11 +484,21 @@ ldap-search attrsonly ,attrsonly withdn ,withdn ,@host-plist)))) - (if ldap-ignore-attribute-codings - result + (cond + (ldap-ignore-attribute-codings + result) + (withdn + ;; Do not process first element of RECORD with + ;; `ldap-decode-attribute' if WITHDN is non-nil. (Bug#64089) (mapcar (lambda (record) - (mapcar #'ldap-decode-attribute record)) - result)))) + (cons (car record) + (mapcar #'ldap-decode-attribute + (cdr record)))) + result)) + (t + (mapcar (lambda (record) + (mapcar #'ldap-decode-attribute record)) + result))))) (defun ldap-password-read (host) "Read LDAP password for HOST. -- 2.30.2