GNU bug report logs - #62721
30.0.50; EUDC: stop adding a wildcard to LDAP searches

Previous Next

Package: emacs;

Reported by: Fabrice Bauzac-Stehly <libnoon <at> orange.fr>

Date: Sat, 8 Apr 2023 07:21:02 UTC

Severity: normal

Found in version 30.0.50

Done: Thomas Fitzsimmons <fitzsim <at> fitzsim.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 62721 in the body.
You can then email your comments to 62721 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#62721; Package emacs. (Sat, 08 Apr 2023 07:21:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Fabrice Bauzac-Stehly <libnoon <at> orange.fr>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 08 Apr 2023 07:21:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Fabrice Bauzac-Stehly <libnoon <at> orange.fr>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; EUDC: stop adding a wildcard to LDAP searches
Date: Sat, 08 Apr 2023 09:20:36 +0200
[Message part 1 (text/plain, inline)]
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?

[0001-Don-t-add-a-wildcard-to-LDAP-query-items.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
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

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62721; Package emacs. (Mon, 10 Apr 2023 14:30:02 GMT) Full text and rfc822 format available.

Message #8 received at 62721 <at> debbugs.gnu.org (full text, mbox):

From: Filipp Gunbin <fgunbin <at> fastmail.fm>
To: Fabrice Bauzac-Stehly <libnoon <at> orange.fr>
Cc: 62721 <at> debbugs.gnu.org
Subject: Re: bug#62721: 30.0.50; EUDC: stop adding a wildcard to LDAP searches
Date: Mon, 10 Apr 2023 17:29:35 +0300
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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62721; Package emacs. (Mon, 10 Apr 2023 19:10:01 GMT) Full text and rfc822 format available.

Message #11 received at 62721 <at> debbugs.gnu.org (full text, mbox):

From: Fabrice Bauzac-Stehly <libnoon <at> orange.fr>
To: Filipp Gunbin <fgunbin <at> fastmail.fm>
Cc: 62721 <at> debbugs.gnu.org
Subject: Re: bug#62721: 30.0.50; EUDC: stop adding a wildcard to LDAP searches
Date: Mon, 10 Apr 2023 21:09:46 +0200
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!




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62721; Package emacs. (Mon, 10 Apr 2023 19:37:01 GMT) Full text and rfc822 format available.

Message #14 received at 62721 <at> debbugs.gnu.org (full text, mbox):

From: Filipp Gunbin <fgunbin <at> fastmail.fm>
To: Fabrice Bauzac-Stehly <libnoon <at> orange.fr>
Cc: 62721 <at> debbugs.gnu.org
Subject: Re: bug#62721: 30.0.50; EUDC: stop adding a wildcard to LDAP searches
Date: Mon, 10 Apr 2023 22:36:18 +0300
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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62721; Package emacs. (Wed, 19 Apr 2023 12:50:02 GMT) Full text and rfc822 format available.

Message #17 received at 62721 <at> debbugs.gnu.org (full text, mbox):

From: Thomas Fitzsimmons <fitzsim <at> fitzsim.org>
To: Fabrice Bauzac-Stehly <libnoon <at> orange.fr>
Cc: 62721 <at> debbugs.gnu.org, Filipp Gunbin <fgunbin <at> fastmail.fm>
Subject: Re: bug#62721: 30.0.50; EUDC: stop adding a wildcard to LDAP searches
Date: Wed, 19 Apr 2023 08:48:54 -0400
Hi Fabrice,

Filipp Gunbin <fgunbin <at> 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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62721; Package emacs. (Sun, 14 May 2023 19:11:01 GMT) Full text and rfc822 format available.

Message #20 received at 62721 <at> debbugs.gnu.org (full text, mbox):

From: Fabrice Bauzac-Stehly <libnoon <at> orange.fr>
To: Thomas Fitzsimmons <fitzsim <at> fitzsim.org>
Cc: 62721 <at> debbugs.gnu.org, fgunbin <at> fastmail.fm
Subject: Re: bug#62721: 30.0.50; EUDC: stop adding a wildcard to LDAP searches
Date: Sun, 14 May 2023 21:10:52 +0200
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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62721; Package emacs. (Mon, 15 May 2023 18:29:01 GMT) Full text and rfc822 format available.

Message #23 received at 62721 <at> debbugs.gnu.org (full text, mbox):

From: Thomas Fitzsimmons <fitzsim <at> fitzsim.org>
To: Fabrice Bauzac-Stehly <libnoon <at> orange.fr>
Cc: 62721 <at> debbugs.gnu.org, fgunbin <at> fastmail.fm
Subject: Re: bug#62721: 30.0.50; EUDC: stop adding a wildcard to LDAP searches
Date: Mon, 15 May 2023 14:28:39 -0400
Hi Fabrice,

Fabrice Bauzac-Stehly <libnoon <at> 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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62721; Package emacs. (Mon, 15 May 2023 20:16:01 GMT) Full text and rfc822 format available.

Message #26 received at 62721 <at> debbugs.gnu.org (full text, mbox):

From: Fabrice Bauzac-Stehly <libnoon <at> orange.fr>
To: Thomas Fitzsimmons <fitzsim <at> fitzsim.org>
Cc: 62721 <at> debbugs.gnu.org, fgunbin <at> fastmail.fm
Subject: Re: bug#62721: 30.0.50; EUDC: stop adding a wildcard to LDAP searches
Date: Mon, 15 May 2023 22:15:49 +0200
Hello Thomas,

Thomas Fitzsimmons <fitzsim <at> 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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62721; Package emacs. (Mon, 15 May 2023 20:37:02 GMT) Full text and rfc822 format available.

Message #29 received at 62721 <at> debbugs.gnu.org (full text, mbox):

From: Thomas Fitzsimmons <fitzsim <at> fitzsim.org>
To: Fabrice Bauzac-Stehly <libnoon <at> orange.fr>
Cc: 62721 <at> debbugs.gnu.org, fgunbin <at> fastmail.fm
Subject: Re: bug#62721: 30.0.50; EUDC: stop adding a wildcard to LDAP searches
Date: Mon, 15 May 2023 16:36:43 -0400
Fabrice Bauzac-Stehly <libnoon <at> orange.fr> writes:

> Hello Thomas,
>
> Thomas Fitzsimmons <fitzsim <at> 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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62721; Package emacs. (Mon, 15 May 2023 20:41:02 GMT) Full text and rfc822 format available.

Message #32 received at 62721 <at> debbugs.gnu.org (full text, mbox):

From: Thomas Fitzsimmons <fitzsim <at> fitzsim.org>
To: Fabrice Bauzac-Stehly <libnoon <at> orange.fr>
Cc: 62721 <at> debbugs.gnu.org, fgunbin <at> fastmail.fm
Subject: Re: bug#62721: 30.0.50; EUDC: stop adding a wildcard to LDAP searches
Date: Mon, 15 May 2023 16:40:12 -0400
Thomas Fitzsimmons <fitzsim <at> fitzsim.org> writes:

> Fabrice Bauzac-Stehly <libnoon <at> orange.fr> writes:
>
>> Hello Thomas,
>>
>> Thomas Fitzsimmons <fitzsim <at> 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")))






Reply sent to Thomas Fitzsimmons <fitzsim <at> fitzsim.org>:
You have taken responsibility. (Mon, 15 May 2023 21:57:02 GMT) Full text and rfc822 format available.

Notification sent to Fabrice Bauzac-Stehly <libnoon <at> orange.fr>:
bug acknowledged by developer. (Mon, 15 May 2023 21:57:02 GMT) Full text and rfc822 format available.

Message #37 received at 62721-done <at> debbugs.gnu.org (full text, mbox):

From: Thomas Fitzsimmons <fitzsim <at> fitzsim.org>
To: Fabrice Bauzac-Stehly <libnoon <at> orange.fr>
Cc: fgunbin <at> fastmail.fm, 62721-done <at> debbugs.gnu.org
Subject: Re: bug#62721: 30.0.50; EUDC: stop adding a wildcard to LDAP searches
Date: Mon, 15 May 2023 17:56:23 -0400
Hi Fabrice,

I pushed the documentation change.  Let me know if it doesn't accurately
describe your use case, and I'll push a rewording.  I'm closing this bug
report.  Thank you for creating it.

Thomas




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62721; Package emacs. (Tue, 16 May 2023 08:15:01 GMT) Full text and rfc822 format available.

Message #40 received at 62721 <at> debbugs.gnu.org (full text, mbox):

From: Fabrice Bauzac-Stehly <libnoon <at> orange.fr>
To: Thomas Fitzsimmons <fitzsim <at> fitzsim.org>
Cc: 62721 <at> debbugs.gnu.org, fgunbin <at> fastmail.fm
Subject: Re: bug#62721: 30.0.50; EUDC: stop adding a wildcard to LDAP searches
Date: Tue, 16 May 2023 10:14:14 +0200
Thomas Fitzsimmons <fitzsim <at> fitzsim.org> writes:

> Fabrice Bauzac-Stehly <libnoon <at> 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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62721; Package emacs. (Tue, 16 May 2023 08:25:01 GMT) Full text and rfc822 format available.

Message #43 received at 62721 <at> debbugs.gnu.org (full text, mbox):

From: Fabrice Bauzac-Stehly <libnoon <at> orange.fr>
To: Thomas Fitzsimmons <fitzsim <at> fitzsim.org>
Cc: 62721 <at> debbugs.gnu.org, fgunbin <at> fastmail.fm
Subject: Re: bug#62721: 30.0.50; EUDC: stop adding a wildcard to LDAP searches
Date: Tue, 16 May 2023 10:24:28 +0200
Thomas Fitzsimmons <fitzsim <at> fitzsim.org> writes:

> I'll just share my proposed patch.  Does the documentation change
> capture your use case?

Apart from the fact that the symbol "samaccountname" corresponds to the
field of the same name, this looks good to me!

Thanks!

-- 
Fabrice Bauzac-Stehly
PGP 01EEACF8244E9C14B551C5256ADA5F189BD322B6




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62721; Package emacs. (Tue, 16 May 2023 10:59:02 GMT) Full text and rfc822 format available.

Message #46 received at 62721 <at> debbugs.gnu.org (full text, mbox):

From: Thomas Fitzsimmons <fitzsim <at> fitzsim.org>
To: Fabrice Bauzac-Stehly <libnoon <at> orange.fr>
Cc: 62721 <at> debbugs.gnu.org, fgunbin <at> fastmail.fm
Subject: Re: bug#62721: 30.0.50; EUDC: stop adding a wildcard to LDAP searches
Date: Tue, 16 May 2023 06:57:59 -0400
Fabrice Bauzac-Stehly <libnoon <at> orange.fr> writes:

> Thomas Fitzsimmons <fitzsim <at> fitzsim.org> writes:
>
>> Fabrice Bauzac-Stehly <libnoon <at> 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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62721; Package emacs. (Wed, 17 May 2023 06:13:02 GMT) Full text and rfc822 format available.

Message #49 received at 62721 <at> debbugs.gnu.org (full text, mbox):

From: Fabrice Bauzac-Stehly <libnoon <at> orange.fr>
To: Thomas Fitzsimmons <fitzsim <at> fitzsim.org>
Cc: 62721 <at> debbugs.gnu.org, fgunbin <at> fastmail.fm
Subject: Re: bug#62721: 30.0.50; EUDC: stop adding a wildcard to LDAP searches
Date: Wed, 17 May 2023 08:12:21 +0200
Thomas Fitzsimmons <fitzsim <at> 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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62721; Package emacs. (Wed, 17 May 2023 11:02:01 GMT) Full text and rfc822 format available.

Message #52 received at 62721 <at> debbugs.gnu.org (full text, mbox):

From: Thomas Fitzsimmons <fitzsim <at> fitzsim.org>
To: Fabrice Bauzac-Stehly <libnoon <at> orange.fr>
Cc: 62721 <at> debbugs.gnu.org, fgunbin <at> fastmail.fm
Subject: Re: bug#62721: 30.0.50; EUDC: stop adding a wildcard to LDAP searches
Date: Wed, 17 May 2023 07:01:21 -0400
Fabrice Bauzac-Stehly <libnoon <at> orange.fr> writes:

> Thomas Fitzsimmons <fitzsim <at> 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




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 14 Jun 2023 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 289 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.