From 24a8481b09411a1d4295c6ef7d5488a4e353f424 Mon Sep 17 00:00:00 2001 From: Jens Schmidt Date: Sun, 18 Jun 2023 11:42:35 +0200 Subject: [PATCH 1/2] Undo suboptimal fix for dn line parsing The previous fix for `ldap-search' erroring out with `wrong-type-argument listp' does not provide API stability in all cases. * lisp/net/ldap.el (ldap-search-internal): Back out that fix. (Bug#64089) --- lisp/net/ldap.el | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/lisp/net/ldap.el b/lisp/net/ldap.el index 8897c3b6d54..78405414a28 100644 --- a/lisp/net/ldap.el +++ b/lisp/net/ldap.el @@ -703,17 +703,7 @@ ldap-search-internal (while (progn (skip-chars-forward " \t\n") (not (eobp))) - ;; Ignore first (dn) line if WITHDN equals nil. If WITHDN - ;; is non-nil, check syntax of the line and split it into a - ;; pair as expected by `ldap-decode-attribute' (Bug#64089). - ;; If the syntax is wrong, better throw an error here, since - ;; otherwise `ldap-decode-attribute' would throw a much less - ;; comprehensible error later. - (cond ((not withdn)) - ((looking-at "dn[=:\t ]+\\(.*\\)$") - (setq dn (list "dn" (match-string 1)))) - (t (error "Incorrect dn line \"%s\" in ldapsearch result" - (buffer-substring (point) (line-end-position))))) + (setq dn (buffer-substring (point) (line-end-position))) (forward-line 1) (while (looking-at "^\\([A-Za-z][-A-Za-z0-9]*\ \\|[0-9]+\\(?:\\.[0-9]+\\)*\\)\\(;[-A-Za-z0-9]+\\)*[=:\t ]+\ -- 2.30.2