From e8154b9edba399d0625d0a4a848e0ad0b43b6f6e Mon Sep 17 00:00:00 2001 From: Darold Date: Sun, 7 Oct 2012 23:11:28 +0200 Subject: [PATCH] Remove space in user alias to prevent corruption of data files. Thanks to Robert Becskei for the report. --- SquidAnalyzer.pm | 1 + user-aliases | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/SquidAnalyzer.pm b/SquidAnalyzer.pm index db486c2..dc49830 100644 --- a/SquidAnalyzer.pm +++ b/SquidAnalyzer.pm @@ -2939,6 +2939,7 @@ sub parse_user_aliases $i++; next if (!$l || ($l =~ /^[\s\t]*#/)); my @data = split(/[\t]+/, $l, 2); + $data[0] =~ s/\s+/_/g; # Replace space, they are not allowed if ($#data == 1) { push(@{$alias{$data[0]}}, split(/[\s,;\t]/, $data[1])); } else { diff --git a/user-aliases b/user-aliases index aa3758f..b6ac34e 100644 --- a/user-aliases +++ b/user-aliases @@ -1,7 +1,8 @@ #------------------------------------------------------------------------------- # Squid Analyzer User Alias configuration file # FORMAT : FULL_USER_NAME IP_ADDRESS|LOGIN_NAME,LOGIN_REGEX -# Field separator must be one or more tabulation. See example bellow +# Field separator must be one or more tabulation. Space in user name are not +# allowed. See example bellow #------------------------------------------------------------------------------- #MyFirstName mylogin,192.168.1.12 #MyOtherNames logon\d+