* bug#62721: 30.0.50; EUDC: stop adding a wildcard to LDAP searches
@ 2023-04-08 7:20 Fabrice Bauzac-Stehly
2023-04-10 14:29 ` Filipp Gunbin
0 siblings, 1 reply; 16+ messages in thread
From: Fabrice Bauzac-Stehly @ 2023-04-08 7:20 UTC (permalink / raw)
To: 62721
[-- 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
^ permalink raw reply related [flat|nested] 16+ messages in thread
* bug#62721: 30.0.50; EUDC: stop adding a wildcard to LDAP searches
2023-04-08 7:20 bug#62721: 30.0.50; EUDC: stop adding a wildcard to LDAP searches Fabrice Bauzac-Stehly
@ 2023-04-10 14:29 ` Filipp Gunbin
2023-04-10 19:09 ` Fabrice Bauzac-Stehly
0 siblings, 1 reply; 16+ messages in thread
From: Filipp Gunbin @ 2023-04-10 14:29 UTC (permalink / raw)
To: Fabrice Bauzac-Stehly; +Cc: 62721
On 08/04/2023 09:20 +0200, Fabrice Bauzac-Stehly wrote:
> 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?
>
Hi,
The wildcard is there so you can use partial values with M-x
eudc-expand-inline (and also in M-x eudc-query-form and others).
You can customize eudc-ldap-no-wildcard-attributes, or just let-bind it
around your code.
Thanks.
^ permalink raw reply [flat|nested] 16+ messages in thread
* bug#62721: 30.0.50; EUDC: stop adding a wildcard to LDAP searches
2023-04-10 14:29 ` Filipp Gunbin
@ 2023-04-10 19:09 ` Fabrice Bauzac-Stehly
2023-04-10 19:36 ` Filipp Gunbin
0 siblings, 1 reply; 16+ messages in thread
From: Fabrice Bauzac-Stehly @ 2023-04-10 19:09 UTC (permalink / raw)
To: Filipp Gunbin; +Cc: 62721
Hello,
Sorry, I have not put sufficient information in my initial message. In
my case, I'm using eudc-query-form, where I know I can add wildcards to
the fields if I want. My complaint is about the fact that a wildcard is
imposed on me in this case, with annoying consequences. Thanks to your
message, I understand though that this automatic wildcard may be useful
in other contexts where `eudc-ldap-format-query-as-rfc1558' is called.
Customizing `eudc-ldap-no-wildcard-attributes' would work in the sense
that I could disable the wildcards in all cases, but I suspect this
solution is not ideal as it would also disable it in the case of
eudc-expand-inline where (as I understand from your message) it would
actually be useful.
I think that in the case of eudc-query-form, no wildcard should ever be
added. What do you think? Should we pass some parameter so that
eudc-ldap-format-query-as-rfc1558 knows what to do?
Thanks!
^ permalink raw reply [flat|nested] 16+ messages in thread
* bug#62721: 30.0.50; EUDC: stop adding a wildcard to LDAP searches
2023-04-10 19:09 ` Fabrice Bauzac-Stehly
@ 2023-04-10 19:36 ` Filipp Gunbin
2023-04-19 12:48 ` Thomas Fitzsimmons
0 siblings, 1 reply; 16+ messages in thread
From: Filipp Gunbin @ 2023-04-10 19:36 UTC (permalink / raw)
To: Fabrice Bauzac-Stehly; +Cc: 62721
On 10/04/2023 21:09 +0200, Fabrice Bauzac-Stehly wrote:
> Hello,
>
> Sorry, I have not put sufficient information in my initial message. In
> my case, I'm using eudc-query-form, where I know I can add wildcards to
> the fields if I want. My complaint is about the fact that a wildcard is
> imposed on me in this case, with annoying consequences. Thanks to your
> message, I understand though that this automatic wildcard may be useful
> in other contexts where `eudc-ldap-format-query-as-rfc1558' is called.
>
> Customizing `eudc-ldap-no-wildcard-attributes' would work in the sense
> that I could disable the wildcards in all cases, but I suspect this
> solution is not ideal as it would also disable it in the case of
> eudc-expand-inline where (as I understand from your message) it would
> actually be useful.
>
> I think that in the case of eudc-query-form, no wildcard should ever be
> added. What do you think? Should we pass some parameter so that
> eudc-ldap-format-query-as-rfc1558 knows what to do?
>
> Thanks!
To me, it's always useful to have wildcard.
Would this simple advice help in your case? I tried it with mail,
replace it with your attributes.
(defun my/eudc-process-form (orig &rest args)
(let ((eudc-ldap-no-wildcard-attributes
(cons 'mail eudc-ldap-no-wildcard-attributes)))
(apply orig args)))
(advice-add 'eudc-process-form :around #'my/eudc-process-form)
Thanks.
^ permalink raw reply [flat|nested] 16+ messages in thread
* bug#62721: 30.0.50; EUDC: stop adding a wildcard to LDAP searches
2023-04-10 19:36 ` Filipp Gunbin
@ 2023-04-19 12:48 ` Thomas Fitzsimmons
2023-05-14 19:10 ` Fabrice Bauzac-Stehly
0 siblings, 1 reply; 16+ messages in thread
From: Thomas Fitzsimmons @ 2023-04-19 12:48 UTC (permalink / raw)
To: Fabrice Bauzac-Stehly; +Cc: 62721, Filipp Gunbin
Hi Fabrice,
Filipp Gunbin <fgunbin@fastmail.fm> writes:
> On 10/04/2023 21:09 +0200, Fabrice Bauzac-Stehly wrote:
>
>> Hello,
>>
>> Sorry, I have not put sufficient information in my initial message. In
>> my case, I'm using eudc-query-form, where I know I can add wildcards to
>> the fields if I want. My complaint is about the fact that a wildcard is
>> imposed on me in this case, with annoying consequences. Thanks to your
>> message, I understand though that this automatic wildcard may be useful
>> in other contexts where `eudc-ldap-format-query-as-rfc1558' is called.
>>
>> Customizing `eudc-ldap-no-wildcard-attributes' would work in the sense
>> that I could disable the wildcards in all cases, but I suspect this
>> solution is not ideal as it would also disable it in the case of
>> eudc-expand-inline where (as I understand from your message) it would
>> actually be useful.
>>
>> I think that in the case of eudc-query-form, no wildcard should ever be
>> added. What do you think? Should we pass some parameter so that
>> eudc-ldap-format-query-as-rfc1558 knows what to do?
>>
>> Thanks!
>
> To me, it's always useful to have wildcard.
>
> Would this simple advice help in your case? I tried it with mail,
> replace it with your attributes.
>
> (defun my/eudc-process-form (orig &rest args)
> (let ((eudc-ldap-no-wildcard-attributes
> (cons 'mail eudc-ldap-no-wildcard-attributes)))
> (apply orig args)))
>
> (advice-add 'eudc-process-form :around #'my/eudc-process-form)
Did the advice that Filipp suggested work for you?
Maybe we could add a checkbox to eudc-query-form whether to tack on a
wildcard or not, defaulted to the value of
eudc-ldap-no-wildcard-attributes.
Thomas
^ permalink raw reply [flat|nested] 16+ messages in thread
* bug#62721: 30.0.50; EUDC: stop adding a wildcard to LDAP searches
2023-04-19 12:48 ` Thomas Fitzsimmons
@ 2023-05-14 19:10 ` Fabrice Bauzac-Stehly
2023-05-15 18:28 ` Thomas Fitzsimmons
0 siblings, 1 reply; 16+ messages in thread
From: Fabrice Bauzac-Stehly @ 2023-05-14 19:10 UTC (permalink / raw)
To: Thomas Fitzsimmons; +Cc: 62721, fgunbin
Hello,
For the time being, on my side, I customize "Eudc Ldap No Wildcard
Attributes" by adding to this list the attribute for which I don't want
an automatic "*" wildcard appended.
As a software engineer, I suspect this issue could be better addressed
by the Emacs codebase, because I don't think it is wise for
eudc-query-form to arbitrarily add an automatic wildcard to the last
field, this does not make sense to me. But I'll let Emacs experts think
about it.
As far as I'm concerned, I have this workaround that works for me.
Thanks!
Best regards
--
Fabrice Bauzac-Stehly
PGP 01EEACF8244E9C14B551C5256ADA5F189BD322B6
^ permalink raw reply [flat|nested] 16+ messages in thread
* bug#62721: 30.0.50; EUDC: stop adding a wildcard to LDAP searches
2023-05-14 19:10 ` Fabrice Bauzac-Stehly
@ 2023-05-15 18:28 ` Thomas Fitzsimmons
2023-05-15 20:15 ` Fabrice Bauzac-Stehly
0 siblings, 1 reply; 16+ messages in thread
From: Thomas Fitzsimmons @ 2023-05-15 18:28 UTC (permalink / raw)
To: Fabrice Bauzac-Stehly; +Cc: 62721, fgunbin
Hi Fabrice,
Fabrice Bauzac-Stehly <libnoon@orange.fr> writes:
> For the time being, on my side, I customize "Eudc Ldap No Wildcard
> Attributes" by adding to this list the attribute for which I don't want
> an automatic "*" wildcard appended.
Do you mind posting the `eudc-ldap-no-wildcard-attributes' setting you
ended up with? The docstring for that variable doesn't mention
adjusting this as a preference, only LDAP failure workarounds. I would
like to update the docstring with an example, to make your use case more
discoverable.
> As a software engineer, I suspect this issue could be better addressed
> by the Emacs codebase, because I don't think it is wise for
> eudc-query-form to arbitrarily add an automatic wildcard to the last
> field, this does not make sense to me. But I'll let Emacs experts think
> about it.
>
> As far as I'm concerned, I have this workaround that works for me.
OK, thanks for following up. My feeling is that someone using both
`eudc-query-form' and `eudc-expand-inline' would want the behaviour of
both functions to match with respect to wildcard addition. And
`eudc-ldap-no-wildcard-attributes' allows the user to customize the
behaviour to their preference/expectation (which you've done), so I
think this is fine as-is (except the docstring).
Thomas
^ permalink raw reply [flat|nested] 16+ messages in thread
* bug#62721: 30.0.50; EUDC: stop adding a wildcard to LDAP searches
2023-05-15 18:28 ` Thomas Fitzsimmons
@ 2023-05-15 20:15 ` Fabrice Bauzac-Stehly
2023-05-15 20:36 ` Thomas Fitzsimmons
0 siblings, 1 reply; 16+ messages in thread
From: Fabrice Bauzac-Stehly @ 2023-05-15 20:15 UTC (permalink / raw)
To: Thomas Fitzsimmons; +Cc: 62721, fgunbin
Hello Thomas,
Thomas Fitzsimmons <fitzsim@fitzsim.org> writes:
> Do you mind posting the `eudc-ldap-no-wildcard-attributes' setting you
> ended up with? The docstring for that variable doesn't mention
> adjusting this as a preference, only LDAP failure workarounds. I
> would like to update the docstring with an example, to make your use
> case more discoverable.
Sure. I have kept the two default items of the list, and added
'samaccountname (the attribute for which I don't want any wildcard). As
I've used Customize, it appears like this in my ~/.emacs.d/init.el:
'(eudc-ldap-no-wildcard-attributes '(objectclass objectcategory samaccountname))
Thanks!
--
Fabrice Bauzac-Stehly
PGP 01EEACF8244E9C14B551C5256ADA5F189BD322B6
^ permalink raw reply [flat|nested] 16+ messages in thread
* bug#62721: 30.0.50; EUDC: stop adding a wildcard to LDAP searches
2023-05-15 20:15 ` Fabrice Bauzac-Stehly
@ 2023-05-15 20:36 ` Thomas Fitzsimmons
2023-05-15 20:40 ` Thomas Fitzsimmons
2023-05-16 8:14 ` Fabrice Bauzac-Stehly
0 siblings, 2 replies; 16+ messages in thread
From: Thomas Fitzsimmons @ 2023-05-15 20:36 UTC (permalink / raw)
To: Fabrice Bauzac-Stehly; +Cc: 62721, fgunbin
Fabrice Bauzac-Stehly <libnoon@orange.fr> writes:
> Hello Thomas,
>
> Thomas Fitzsimmons <fitzsim@fitzsim.org> writes:
>
>> Do you mind posting the `eudc-ldap-no-wildcard-attributes' setting you
>> ended up with? The docstring for that variable doesn't mention
>> adjusting this as a preference, only LDAP failure workarounds. I
>> would like to update the docstring with an example, to make your use
>> case more discoverable.
>
> Sure. I have kept the two default items of the list, and added
> 'samaccountname (the attribute for which I don't want any wildcard). As
> I've used Customize, it appears like this in my ~/.emacs.d/init.el:
>
> '(eudc-ldap-no-wildcard-attributes '(objectclass objectcategory samaccountname))
Thanks, and what field of `eudc-query-form' does that affect? "E-Mail"?
Thomas
^ permalink raw reply [flat|nested] 16+ messages in thread
* bug#62721: 30.0.50; EUDC: stop adding a wildcard to LDAP searches
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
1 sibling, 2 replies; 16+ messages in thread
From: Thomas Fitzsimmons @ 2023-05-15 20:40 UTC (permalink / raw)
To: Fabrice Bauzac-Stehly; +Cc: 62721, fgunbin
Thomas Fitzsimmons <fitzsim@fitzsim.org> writes:
> Fabrice Bauzac-Stehly <libnoon@orange.fr> writes:
>
>> Hello Thomas,
>>
>> Thomas Fitzsimmons <fitzsim@fitzsim.org> writes:
>>
>>> Do you mind posting the `eudc-ldap-no-wildcard-attributes' setting you
>>> ended up with? The docstring for that variable doesn't mention
>>> adjusting this as a preference, only LDAP failure workarounds. I
>>> would like to update the docstring with an example, to make your use
>>> case more discoverable.
>>
>> Sure. I have kept the two default items of the list, and added
>> 'samaccountname (the attribute for which I don't want any wildcard). As
>> I've used Customize, it appears like this in my ~/.emacs.d/init.el:
>>
>> '(eudc-ldap-no-wildcard-attributes '(objectclass objectcategory samaccountname))
>
> Thanks, and what field of `eudc-query-form' does that affect?
> "E-Mail"?
I'll just share my proposed patch. Does the documentation change
capture your use case?
Thanks,
Thomas
EUDC: Document disabling default LDAP wildcard expansion
* lisp/net/eudc-vars.el (eudc-ldap-no-wildcard-attributes): Cover
`eudc-query-form' and `eudc-expand-inline' behavior in the
customization docstring. (Bug#62721)
diff --git a/lisp/net/eudc-vars.el b/lisp/net/eudc-vars.el
index 12f5347bd35..b3aa23f5827 100644
--- a/lisp/net/eudc-vars.el
+++ b/lisp/net/eudc-vars.el
@@ -441,7 +441,12 @@ eudc-ldap-no-wildcard-attributes
"LDAP attributes which are always searched for without wildcard character.
This is the list of special dictionary-valued attributes, where
wildcarded search may fail. For example, it fails with
-objectclass in Active Directory servers."
+objectclass in Active Directory servers.
+
+You may not want functions like `eudc-query-form' and
+`eudc-expand-inline' to do LDAP wildcard expansion by default on
+certain fields. If so, add the relevant symbol to this list, for
+example `samaccountname' for the \"E-Mail\" field."
:type '(repeat (symbol :tag "Directory attribute")))
^ permalink raw reply related [flat|nested] 16+ messages in thread
* bug#62721: 30.0.50; EUDC: stop adding a wildcard to LDAP searches
2023-05-15 20:36 ` Thomas Fitzsimmons
2023-05-15 20:40 ` Thomas Fitzsimmons
@ 2023-05-16 8:14 ` Fabrice Bauzac-Stehly
2023-05-16 10:57 ` Thomas Fitzsimmons
1 sibling, 1 reply; 16+ messages in thread
From: Fabrice Bauzac-Stehly @ 2023-05-16 8:14 UTC (permalink / raw)
To: Thomas Fitzsimmons; +Cc: 62721, fgunbin
Thomas Fitzsimmons <fitzsim@fitzsim.org> writes:
> Fabrice Bauzac-Stehly <libnoon@orange.fr> writes:
>
>> Sure. I have kept the two default items of the list, and added
>> 'samaccountname (the attribute for which I don't want any wildcard). As
>> I've used Customize, it appears like this in my ~/.emacs.d/init.el:
>>
>> '(eudc-ldap-no-wildcard-attributes '(objectclass objectcategory samaccountname))
>
> Thanks, and what field of `eudc-query-form' does that affect? "E-Mail"?
It affects samaccountname. Indeed, I forgot to indicate that I have
also customized eudc-query-form-attributes:
'(eudc-default-return-attributes
'(displayname firstname name thumbnailphoto mail samaccountname ...))
'(eudc-ldap-no-wildcard-attributes '(objectclass objectcategory samaccountname))
'(eudc-query-form-attributes '(name firstname email samaccountname))
Thanks!
--
Fabrice Bauzac-Stehly
PGP 01EEACF8244E9C14B551C5256ADA5F189BD322B6
^ permalink raw reply [flat|nested] 16+ messages in thread
* bug#62721: 30.0.50; EUDC: stop adding a wildcard to LDAP searches
2023-05-16 8:14 ` Fabrice Bauzac-Stehly
@ 2023-05-16 10:57 ` Thomas Fitzsimmons
2023-05-17 6:12 ` Fabrice Bauzac-Stehly
0 siblings, 1 reply; 16+ messages in thread
From: Thomas Fitzsimmons @ 2023-05-16 10:57 UTC (permalink / raw)
To: Fabrice Bauzac-Stehly; +Cc: 62721, fgunbin
Fabrice Bauzac-Stehly <libnoon@orange.fr> writes:
> Thomas Fitzsimmons <fitzsim@fitzsim.org> writes:
>
>> Fabrice Bauzac-Stehly <libnoon@orange.fr> writes:
>>
>>> Sure. I have kept the two default items of the list, and added
>>> 'samaccountname (the attribute for which I don't want any wildcard). As
>>> I've used Customize, it appears like this in my ~/.emacs.d/init.el:
>>>
>>> '(eudc-ldap-no-wildcard-attributes '(objectclass objectcategory samaccountname))
>>
>> Thanks, and what field of `eudc-query-form' does that affect? "E-Mail"?
>
> It affects samaccountname. Indeed, I forgot to indicate that I have
> also customized eudc-query-form-attributes:
>
> '(eudc-default-return-attributes
> '(displayname firstname name thumbnailphoto mail samaccountname ...))
> '(eudc-ldap-no-wildcard-attributes '(objectclass objectcategory samaccountname))
> '(eudc-query-form-attributes '(name firstname email samaccountname))
Oh, OK. Can you test how to apply this to the standard "E-Mail"
attribute in `eudc-query-form'? I forget if I want "mail" or "email"
for SYMBOL here:
You may not want functions like `eudc-query-form' and
`eudc-expand-inline' to do LDAP wildcard expansion by default on
certain fields. If so, add the relevant symbol to this list, for
example `SYMBOL' for the \"E-Mail\" field.
Then I'll push the updated patch.
Thanks,
Thomas
^ permalink raw reply [flat|nested] 16+ messages in thread
* bug#62721: 30.0.50; EUDC: stop adding a wildcard to LDAP searches
2023-05-16 10:57 ` Thomas Fitzsimmons
@ 2023-05-17 6:12 ` Fabrice Bauzac-Stehly
2023-05-17 11:01 ` Thomas Fitzsimmons
0 siblings, 1 reply; 16+ messages in thread
From: Fabrice Bauzac-Stehly @ 2023-05-17 6:12 UTC (permalink / raw)
To: Thomas Fitzsimmons; +Cc: 62721, fgunbin
Thomas Fitzsimmons <fitzsim@fitzsim.org> writes:
> Can you test how to apply this to the standard "E-Mail"
> attribute in `eudc-query-form'? I forget if I want "mail" or "email"
> for SYMBOL here:
I have just tested: to disable wildcards for E-Mail, the symbol to put
into eudc-ldap-no-wildcard-attributes is 'mail.
> Then I'll push the updated patch.
Thanks a lot!
--
Fabrice Bauzac-Stehly
PGP 01EEACF8244E9C14B551C5256ADA5F189BD322B6
^ permalink raw reply [flat|nested] 16+ messages in thread
* bug#62721: 30.0.50; EUDC: stop adding a wildcard to LDAP searches
2023-05-17 6:12 ` Fabrice Bauzac-Stehly
@ 2023-05-17 11:01 ` Thomas Fitzsimmons
0 siblings, 0 replies; 16+ messages in thread
From: Thomas Fitzsimmons @ 2023-05-17 11:01 UTC (permalink / raw)
To: Fabrice Bauzac-Stehly; +Cc: 62721, fgunbin
Fabrice Bauzac-Stehly <libnoon@orange.fr> writes:
> Thomas Fitzsimmons <fitzsim@fitzsim.org> writes:
>
>> Can you test how to apply this to the standard "E-Mail"
>> attribute in `eudc-query-form'? I forget if I want "mail" or "email"
>> for SYMBOL here:
>
> I have just tested: to disable wildcards for E-Mail, the symbol to put
> into eudc-ldap-no-wildcard-attributes is 'mail.
>
>> Then I'll push the updated patch.
Pushed, thanks.
Thomas
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2023-05-17 11:01 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-08 7:20 bug#62721: 30.0.50; EUDC: stop adding a wildcard to LDAP searches Fabrice Bauzac-Stehly
2023-04-10 14:29 ` 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
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).