From 4b4eb136cb5dfe6ad86bb0f9f8d1dcc922104bca Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 5 Jun 2026 14:08:20 +0000 Subject: [PATCH] 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 Signed-off-by: Martin Renvoize Signed-off-by: Pedro Amorim --- Koha/Script.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Koha/Script.pm b/Koha/Script.pm index 4c87a79ed0..66fac4dc35 100644 --- a/Koha/Script.pm +++ b/Koha/Script.pm @@ -47,7 +47,7 @@ our $_cron = 0; # Flag names (matched case-insensitively, substring match) whose following # 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 { my $command_line_options = join( " ", _scrub_argv(@ARGV) );