Fixes #12282
Signed-off-by: Stefan Schantl stefan.schantl@ipfire.org --- html/cgi-bin/ovpnmain.cgi | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi index e76a688fe..22a2b9905 100644 --- a/html/cgi-bin/ovpnmain.cgi +++ b/html/cgi-bin/ovpnmain.cgi @@ -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) {
Hi,
On 28 Jan 2020, at 10:51, Stefan Schantl stefan.schantl@ipfire.org wrote:
Fixes #12282
Signed-off-by: Stefan Schantl stefan.schantl@ipfire.org
html/cgi-bin/ovpnmain.cgi | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi index e76a688fe..22a2b9905 100644 --- a/html/cgi-bin/ovpnmain.cgi +++ b/html/cgi-bin/ovpnmain.cgi @@ -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;
- }
Why does the name of the pool need to be a FQDN?
&General::readhasharray("${General::swroot}/ovpn/ccd.conf", %ccdconfhash); foreach my $key (keys %ccdconfhash) { if ($ccdconfhash{$key}[0] eq $oldname) { -- 2.25.0