]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - html/cgi-bin/ovpnmain.cgi
ovpnmain.cgi: Validate CCDNet name when renaming it.
[ipfire-2.x.git] / html / cgi-bin / ovpnmain.cgi
index a6fdd6d75a547ec40953d8f9e36b60f27902b98a..ce9524df792e628cff6e538abb004d9a948869d3 100644 (file)
@@ -490,6 +490,13 @@ sub modccdnet
        my $oldname=$_[1];
        my %ccdconfhash=();
        my %ccdhash=();
+
+       # Check if the new name is valid.
+       if(!&General::validhostname($newname)) {
+               $errormessage=$Lang::tr{'ccd err invalidname'};
+               return;
+       }
+
        &General::readhasharray("${General::swroot}/ovpn/ccd.conf", \%ccdconfhash);
        foreach my $key (keys %ccdconfhash) {
                if ($ccdconfhash{$key}[0] eq $oldname) {