From: Adolf Belka Date: Wed, 2 Aug 2023 20:09:55 +0000 (+0200) Subject: fwhosts.cgi: Fixes bug#13206 - no validation of location group name X-Git-Tag: v2.27-core179~9^2~56 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d4c30a95e7ced6be67d573f3c9938400eef49c2c;p=ipfire-2.x.git fwhosts.cgi: Fixes bug#13206 - no validation of location group name - Added validation code for the location group name. This is only validated when edited and not when created. - The code was copied from the section for creating the Services Group Name or the Network/Host Group Name. Fixes: Bug#13206 Tested-by: Adolf Belka Signed-off-by: Adolf Belka Reviewed-by: Stefan Schantl Signed-off-by: Michael Tremer --- diff --git a/html/cgi-bin/fwhosts.cgi b/html/cgi-bin/fwhosts.cgi index baf745a0a2..d6be6c40e4 100644 --- a/html/cgi-bin/fwhosts.cgi +++ b/html/cgi-bin/fwhosts.cgi @@ -693,6 +693,9 @@ if ($fwhostsettings{'ACTION'} eq 'savelocationgrp') &General::readhasharray("$fwconfiginp", \%fwinp); &General::readhasharray("$fwconfigout", \%fwout); + # Check name + if (!&validhostname($grp)){$errormessage.=$Lang::tr{'fwhost err name'};} + # Check for existing group name. if (!&checkgroup($grp) && $fwhostsettings{'update'} ne 'on'){ $errormessage = $Lang::tr{'fwhost err grpexist'};