From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Fabrice Bauzac-Stehly Newsgroups: gmane.emacs.bugs Subject: bug#62721: 30.0.50; EUDC: stop adding a wildcard to LDAP searches Date: Sat, 08 Apr 2023 09:20:36 +0200 Message-ID: <874jpqalh7.fsf@fedora.home> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33524"; mail-complaints-to="usenet@ciao.gmane.io" To: 62721@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Apr 08 09:21:13 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pl2sr-0008Tv-FB for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 08 Apr 2023 09:21:13 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pl2sj-0000Gh-0k; Sat, 08 Apr 2023 03:21:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pl2sg-0000Ft-U1 for bug-gnu-emacs@gnu.org; Sat, 08 Apr 2023 03:21:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pl2sg-0000Xp-Lv for bug-gnu-emacs@gnu.org; Sat, 08 Apr 2023 03:21:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pl2sg-0008HS-Gi for bug-gnu-emacs@gnu.org; Sat, 08 Apr 2023 03:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Fabrice Bauzac-Stehly Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Apr 2023 07:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 62721 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.168093844931783 (code B ref -1); Sat, 08 Apr 2023 07:21:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 8 Apr 2023 07:20:49 +0000 Original-Received: from localhost ([127.0.0.1]:57584 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pl2sS-0008GZ-Pt for submit@debbugs.gnu.org; Sat, 08 Apr 2023 03:20:49 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:55194) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pl2sP-0008GQ-Jj for submit@debbugs.gnu.org; Sat, 08 Apr 2023 03:20:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pl2sP-00006h-21 for bug-gnu-emacs@gnu.org; Sat, 08 Apr 2023 03:20:45 -0400 Original-Received: from smtp-25.smtpout.orange.fr ([80.12.242.25] helo=smtp.smtpout.orange.fr) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pl2sM-0000Pl-Fe for bug-gnu-emacs@gnu.org; Sat, 08 Apr 2023 03:20:44 -0400 Original-Received: from fedora.home ([109.210.14.182]) by smtp.orange.fr with ESMTPA id l2sGpERBpV6zQl2sGpVt59; Sat, 08 Apr 2023 09:20:37 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=orange.fr; s=t20230301; t=1680938437; bh=GIZMSMUUug/0fdnJKU0/GzDVy3mrnztZsnHCkoQzt7g=; h=From:To:Subject:Date; b=PO+ZpfiqTPfsyAffZA4iZ1va4iHyljRcDTIYRt5dL9FoFgV7GWO+YNpvoTf9PEEtH nE2zTcTB2UzAmenngrkLyRSC+4Gt3uRcdqJPD1EMS0NRIgvPYMqJ8vjAo/R6c1vU5L ppXhVq6erVeHH0w1CV48HrcLEkM5tF3OSm+YMzAlOc0PmU6sQAI5vhICpDfqJd4ctW RDsyM/w8NsSgMerNmruZLx3vHzUVzU2IhYpyWrMRPLN5uE7dApldqW8NUTalg0i5pF y3oR7KXsc34KGo5AKSw71wsAXXHOSI2p37Z+xNddzTy6HJTQWEA11qNVnl+7Ke1QBS Q8O0987sN/W1Q== X-ME-Helo: fedora.home X-ME-Auth: YmF1emFjLXN0ZWhseS5mYWJyaWNlQG9yYW5nZS5mcg== X-ME-Date: Sat, 08 Apr 2023 09:20:37 +0200 X-ME-IP: 109.210.14.182 Original-Received: from noon by fedora.home with local (Exim 4.96) (envelope-from ) id 1pl2sG-0004cB-0e for bug-gnu-emacs@gnu.org; Sat, 08 Apr 2023 09:20:36 +0200 Received-SPF: pass client-ip=80.12.242.25; envelope-from=libnoon@orange.fr; helo=smtp.smtpout.orange.fr X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:259455 Archived-At: --=-=-= Content-Type: text/plain Hello, I use EUDC to search entries from LDAP. I routinely search for a username to retrieve the email address. The LDAP server contains lots of entries, and a username is often a prefix of lots of other usernames. For example, when I search for the "js" username, I don't want to have dozens of results of usernames that just start with "js" like "jsmith" or "jscott". However, that's what eudcb-ldap does: for reasons I don't understand, the eudc-ldap-format-query-as-rfc1558 defun automatically appends the wildcard character "*" to the last field. This is annoying as I get dozens of results. I want to have the choice of adding a wildcard or not to my searches, I don't want that imposed on me. I propose the attached patch to fix this behaviour. The result is a simplification of the existing code. Could you please review it? --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Don-t-add-a-wildcard-to-LDAP-query-items.patch Content-Description: patch >From 128e243175763606c73cb23beea0b0b25739ce2d Mon Sep 17 00:00:00 2001 From: Fabrice Bauzac Date: Fri, 13 Jan 2023 15:44:35 +0100 Subject: [PATCH] Don't add a wildcard to LDAP query items lisp/net/eudcb-ldap.el (eudc-ldap-format-query-as-rfc1558): don't add an arbitrary wildcard to the last query item. --- lisp/net/eudcb-ldap.el | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/lisp/net/eudcb-ldap.el b/lisp/net/eudcb-ldap.el index b1733e99f5c..f39df13c391 100644 --- a/lisp/net/eudcb-ldap.el +++ b/lisp/net/eudcb-ldap.el @@ -174,21 +174,13 @@ eudc-ldap-escape-query-special-chars (defun eudc-ldap-format-query-as-rfc1558 (query) "Format the EUDC QUERY list as a RFC1558 LDAP search filter." - (let ((formatter - (lambda (item &optional wildcard) - (format "(%s=%s)" - (car item) - (concat - (eudc-ldap-escape-query-special-chars - (cdr item)) - (if (and wildcard - (not (memq (car item) - eudc-ldap-no-wildcard-attributes))) - "*" "")))))) - (format "(&%s)" - (concat - (mapconcat formatter (butlast query) "") - (funcall formatter (car (last query)) t))))) + (let ((formatter (lambda (item) + (format "(%s=%s)" + (car item) + (concat + (eudc-ldap-escape-query-special-chars + (cdr item))))))) + (format "(&%s)" (mapconcat formatter query "")))) ;;}}} -- 2.25.1 --=-=-= Content-Type: text/plain In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, cairo version 1.16.0) of 2023-03-07 built on ncelrnd2571 Repository revision: 4e8b50ec57bc0d70bdb1279756eec679eb4eab0d Repository branch: HEAD Windowing system distributor 'The X.Org Foundation', version 11.0.12013000 System Description: Ubuntu 20.04.6 LTS Configured using: 'configure -C --with-x-toolkit=no' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY OLDXMENU PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF X11 XDBE XIM XINPUT2 XPM ZLIB Important settings: value of $LC_MONETARY: fr_FR.UTF-8 value of $LC_NUMERIC: fr_FR.UTF-8 value of $LC_TIME: C.UTF-8 value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: Outline Minor modes in effect: bug-reference-mode: t global-git-commit-mode: t magit-auto-revert-mode: t auto-revert-mode: t shell-dirtrack-mode: t electric-pair-mode: t server-mode: t tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t line-number-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: /home/fbauzac/.emacs.d/shared/el/1a-snipit hides /home/fbauzac/.emacs.d/elpa/1a-snipit-1.0/1a-snipit /home/fbauzac/.emacs.d/elpa/transient-0.3.7/transient hides /home/fbauzac/git/emacs-master-2023-03-07/lisp/transient Features: (shadow sort mail-extr emacsbug magit-patch magit-subtree magit-extras magit-gitignore magit-ediff ediff ediff-merg ediff-mult ediff-wind ediff-diff ediff-help ediff-init ediff-util dcl-mode tempo conf-mode genpass vc-hg vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs log-view vc bug-reference face-remap cal-iso cal-move tabify man goto-addr network-stream url-cache 1a-snipit dired-aux pcmpl-unix my-present webjump godjira whitespace org-element org-persist org-id org-refile avl-tree generator oc-basic ol-eww eww xdg url-queue mm-url ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect gnus-art mm-uu mml2015 mm-view mml-smime smime gnutls dig gnus-sum shr pixel-fill kinsoku url-file svg dom gnus-group gnus-undo gnus-start gnus-dbus gnus-cloud nnimap nnmail mail-source utf7 nnoo parse-time gnus-spec gnus-int gnus-range gnus-win ol-docview doc-view image-mode exif ol-bibtex bibtex iso8601 ol-bbdb ol-w3m ol-doi org-link-doi org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-src ob-comint org-pcomplete org-list org-footnote org-faces org-entities ob-emacs-lisp ob-core ob-eval org-cycle org-table ol org-fold org-fold-core org-keys oc org-loaddefs org-version org-compat org-macs my-shell epa-file url-http url-auth url-gw nsm secrets dbus xml kinit jka-compr my-timeline ert ewoc calc-arith dabbrev apropos files-x anyconnect shortdoc copyright char-fold misearch multi-isearch help-fns radix-tree cl-print debug backtrace find-func cus-start my-host-resolve fb-jira-menu aproach bms mule-util cal-china lunar solar cal-dst cal-islam holidays holiday-loaddefs vc-git vc-dispatcher appt diary-lib diary-loaddefs cal-menu calendar cal-loaddefs find-lisp filecache my-magit magit-submodule magit-obsolete magit-blame magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit magit-sequence magit-notes magit-worktree magit-tag magit-merge magit-branch magit-reset magit-files magit-refs magit-status magit magit-repos magit-apply magit-wip magit-log which-func imenu magit-diff smerge-mode diff diff-mode easy-mmode git-commit log-edit message sendmail yank-media puny dired dired-loaddefs rfc822 mml mml-sec epa epg rfc6068 epg-config mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils mailheader pcvs-util add-log magit-core magit-autorevert autorevert filenotify magit-margin magit-transient magit-process with-editor shell pcomplete magit-mode transient cl-extra edmacro kmacro help-mode format-spec magit-git magit-section magit-utils crm dash my-bazel my-skeletons skeleton sh-script smie executable cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs python rx project pcase treesit comint ansi-osc ring ansi-color ibuf-macs ibuffer ibuffer-loaddefs calc-prog calc-ext calc calc-loaddefs rect calc-macs gnus nnheader gnus-util text-property-search time-date mail-utils range mm-util mail-prsvr elec-pair delsel eudcb-ldap ldap eudc eudc-options-file eudc-vars auth-source-pass server jira-markup-mode derived thingatpt noutline outline cus-edit pp cus-load icons wid-edit info package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs password-cache json subr-x map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo xinput2 x multi-tty make-network-process emacs) Memory information: ((conses 16 690616 125578) (symbols 48 38019 3) (strings 32 161896 18152) (string-bytes 1 5147041) (vectors 16 85900) (vector-slots 8 1803819 116939) (floats 8 919 748) (intervals 56 42691 2868) (buffers 976 77)) -- Fabrice Bauzac-Stehly PGP 01EEACF8244E9C14B551C5256ADA5F189BD322B6 --=-=-=--