unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Amin Bandali <bandali@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: emacs-devel@gnu.org
Subject: Re: master 893111f 2/2: Hide passwords in .authinfo and .netrc files
Date: Sun, 22 Sep 2019 09:27:16 -0400	[thread overview]
Message-ID: <8736gocvgr.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <87lfugwlrv.fsf@gnus.org>

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Amin Bandali <bandali@gnu.org> writes:
>
>> larsi@gnus.org (Lars Ingebrigtsen) writes:
>>
>>> +      (while (re-search-forward "\\bpassword +\\([^\n\t ]+\\)"
>>
>> Would it make more sense to use '\s-' rather than '\b' here?  With '\b',
>> it will match the ‘password’ in an entry like `gnus-canlock-password'
>> and thus wrongly add the display property to the next word, in this case
>> “password”, rather than to the actual password itself.
>
> Good point.  I used \\b because I was thinking about whether "password"
> could be the first token on a the line, but I've now changed the regexp
> to be
>
> "\\(\\s-\\|^\\)password\\s-+\\([^\n\t ]+\\)"

Works well now, thanks!

On a side note, I wonder it would be too much to have the keyword(s) be
customizeable?  For instance, I use my authinfo file to store entries
with multiple “secret” parts, such as the following:

machine xyz client-id 62308.619 client-secret ce2e92 token x-27f57e9a

It would be nice if there were a defcustom e.g. `authinfo-hidden-parts',
defaulting to “password”, which one could add other keywords to, such as
“client-secret” and “token”.



  reply	other threads:[~2019-09-22 13:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190921100408.13688.51289@vcs0.savannah.gnu.org>
     [not found] ` <20190921100410.7BD4A20520@vcs0.savannah.gnu.org>
2019-09-21 14:05   ` master 893111f 2/2: Hide passwords in .authinfo and .netrc files Amin Bandali
2019-09-22 12:36     ` Lars Ingebrigtsen
2019-09-22 13:27       ` Amin Bandali [this message]
2019-09-22 17:21         ` Lars Ingebrigtsen
2019-09-23  2:06           ` Amin Bandali
2019-09-23 10:28             ` Lars Ingebrigtsen
2019-09-23 13:47               ` Amin Bandali

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=8736gocvgr.fsf@fencepost.gnu.org \
    --to=bandali@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.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).