From: Fabrice Bauzac-Stehly <libnoon@orange.fr>
To: 62721@debbugs.gnu.org
Subject: bug#62721: 30.0.50; EUDC: stop adding a wildcard to LDAP searches
Date: Sat, 08 Apr 2023 09:20:36 +0200 [thread overview]
Message-ID: <874jpqalh7.fsf@fedora.home> (raw)
[-- Attachment #1: Type: text/plain, Size: 843 bytes --]
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?
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-patch, Size: 1543 bytes --]
From 128e243175763606c73cb23beea0b0b25739ce2d Mon Sep 17 00:00:00 2001
From: Fabrice Bauzac <fbauzac@amadeus.com>
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
[-- Attachment #3: Type: text/plain, Size: 6451 bytes --]
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
next reply other threads:[~2023-04-08 7:20 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-08 7:20 Fabrice Bauzac-Stehly [this message]
2023-04-10 14:29 ` bug#62721: 30.0.50; EUDC: stop adding a wildcard to LDAP searches Filipp Gunbin
2023-04-10 19:09 ` Fabrice Bauzac-Stehly
2023-04-10 19:36 ` Filipp Gunbin
2023-04-19 12:48 ` Thomas Fitzsimmons
2023-05-14 19:10 ` Fabrice Bauzac-Stehly
2023-05-15 18:28 ` Thomas Fitzsimmons
2023-05-15 20:15 ` Fabrice Bauzac-Stehly
2023-05-15 20:36 ` Thomas Fitzsimmons
2023-05-15 20:40 ` Thomas Fitzsimmons
2023-05-15 21:56 ` Thomas Fitzsimmons
2023-05-16 8:24 ` Fabrice Bauzac-Stehly
2023-05-16 8:14 ` Fabrice Bauzac-Stehly
2023-05-16 10:57 ` Thomas Fitzsimmons
2023-05-17 6:12 ` Fabrice Bauzac-Stehly
2023-05-17 11:01 ` Thomas Fitzsimmons
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874jpqalh7.fsf@fedora.home \
--to=libnoon@orange.fr \
--cc=62721@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).