Bug 42766: (QA follow-up) Broaden sensitive patterns

We are all lazy, we aren't going to type --password everytime, we should
protect 'p' and 'pass' as well

This could likely get broader too later

TO test:
1 - perl misc/devel/create_superlibrarian.pl --branchcode=CPL --categorycode=S --cardnumber 3 --userid=ted3 --p=dog
2 - Note password is logged
3 - Apply this patch
4 - perl misc/devel/create_superlibrarian.pl --branchcode=CPL --categorycode=S --cardnumber 33 --userid=ted33 --p=dog
5 - Password redacted in log
6 - perl misc/devel/create_superlibrarian.pl --branchcode=CPL --categorycode=S --cardnumber 333 --userid=ted333 --pass=dog
7 - Password still redacted

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
Nick Clemens 2026-06-05 14:08:20 +00:00 committed by Pedro Amorim
parent 53d5112c3a
commit 4b4eb136cb
No known key found for this signature in database
GPG Key ID: 06B75BA7F3894D55
1 changed files with 1 additions and 1 deletions

View File

@ -47,7 +47,7 @@ our $_cron = 0;
# Flag names (matched case-insensitively, substring match) whose following # Flag names (matched case-insensitively, substring match) whose following
# value should be redacted from logged command-line output. # value should be redacted from logged command-line output.
my @_sensitive_patterns = qw( password passwd secret token apikey api_key credential ); my @_sensitive_patterns = qw( password passwd secret token apikey api_key credential ^p$ ^pass$ );
INIT { INIT {
my $command_line_options = join( " ", _scrub_argv(@ARGV) ); my $command_line_options = join( " ", _scrub_argv(@ARGV) );