From 02165cdaf880787b99a0253aec11e072b049c3ef Mon Sep 17 00:00:00 2001 From: Jens Schmidt Date: Sun, 18 Jun 2023 12:10:29 +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 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lisp/net/ldap.el b/lisp/net/ldap.el index 78405414a28..5f42fd6ac2c 100644 --- a/lisp/net/ldap.el +++ b/lisp/net/ldap.el @@ -487,8 +487,13 @@ ldap-search (if ldap-ignore-attribute-codings result (mapcar (lambda (record) - (mapcar #'ldap-decode-attribute record)) - result)))) + ;; Do not process first element of RECORD with + ;; `ldap-decode-attribute' if WITHDN is non-nil. + ;; (Bug#64089) + (append (and withdn (list (car record))) + (mapcar #'ldap-decode-attribute + (if withdn (cdr record) record)))) + result)))) (defun ldap-password-read (host) "Read LDAP password for HOST. -- 2.30.2