]> git.notmuchmail.org Git - notmuch/commit - test/test-lib.sh
test: replace notmuch_passwd_sanitize() with _libconfig_sanitize()
authorTomi Ollila <tomi.ollila@iki.fi>
Sat, 22 May 2021 13:39:57 +0000 (16:39 +0300)
committerDavid Bremner <david@tethera.net>
Sat, 22 May 2021 14:51:29 +0000 (11:51 -0300)
commit8675be1d307bc2df882107744641f6a7858e65ad
treed7838780517218f73c4a9a6e831316e2d1077195
parent3baa61e0e58402bc50c5df529fcf669bf4b2facb
test: replace notmuch_passwd_sanitize() with _libconfig_sanitize()

notmuch_passwd_sanitize() in test-lib.sh is too generic, it cannot
work in many cases...

The more specific version _libconfig_sanitize() replaces it in
T590-libconfig.sh and the code that uses it is modified to output
the keys (ascending numbers printed in hex) so the sanitizer knows
what to sanitize in which lines...

"@" + fqdn -> "@FQDN" replacement is used as fqdn could
-- in theory -- be substring of 'USERNAME'.

'user -> 'USER_FULL_NAME replacement to work in cases where user
is empty -- as only first ' is replaced that works as expected.

In addition to ".(none)" now also ".localdomain" is filtered from
USERNAME@FQDN.

/dev/fd/{n} is not defined in posix, but it is portable enough
(if it weren't it is easy to fix -- now code looks clearer).
test/T590-libconfig.sh
test/test-lib.sh