]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
fwhosts.cgi: Fixes bug#13206 - no validation of location group name
authorAdolf Belka <adolf.belka@ipfire.org>
Wed, 2 Aug 2023 20:09:55 +0000 (22:09 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 7 Aug 2023 09:24:36 +0000 (09:24 +0000)
- 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 <adolf.belka@ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
Reviewed-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
html/cgi-bin/fwhosts.cgi

index baf745a0a2735afcc5197f9d5636a873c529cf30..d6be6c40e4fe342a96db5b0b3d92f1ef10f18d67 100644 (file)
@@ -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'};