[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: master 893111f 2/2: Hide passwords in .authinfo and .netrc files
From: |
Amin Bandali |
Subject: |
Re: master 893111f 2/2: Hide passwords in .authinfo and .netrc files |
Date: |
Sun, 22 Sep 2019 09:27:16 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
Lars Ingebrigtsen <address@hidden> writes:
> Amin Bandali <address@hidden> writes:
>
>> address@hidden (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”.