From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: development@lists.ipfire.org Subject: Re: [PATCH] ovpnmain.cgi: Validate CCDNet name when renaming it. Date: Tue, 28 Jan 2020 15:33:01 +0000 Message-ID: <315D6004-FB95-407B-8E98-8AFF0939D8D9@ipfire.org> In-Reply-To: <20200128105150.5848-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0015835403116371090==" List-Id: --===============0015835403116371090== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi, > On 28 Jan 2020, at 10:51, Stefan Schantl wrot= e: >=20 > Fixes #12282 >=20 > Signed-off-by: Stefan Schantl > --- > html/cgi-bin/ovpnmain.cgi | 7 +++++++ > 1 file changed, 7 insertions(+) >=20 > 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=3D$_[1]; > my %ccdconfhash=3D(); > my %ccdhash=3D(); > + > + # Check if the new name is valid. > + if(!&General::validhostname($newname)) { > + $errormessage=3D$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) { > --=20 > 2.25.0 >=20 --===============0015835403116371090==--