mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-05-13 16:11:37 +02:00
ovpnmain.cgi: Validate CCDNet name when renaming it.
Fixes #12282 Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org> Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
This commit is contained in:
committed by
Arne Fitzenreiter
parent
5c1c9938eb
commit
7ad653cc09
@@ -490,6 +490,13 @@ sub modccdnet
|
|||||||
my $oldname=$_[1];
|
my $oldname=$_[1];
|
||||||
my %ccdconfhash=();
|
my %ccdconfhash=();
|
||||||
my %ccdhash=();
|
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);
|
&General::readhasharray("${General::swroot}/ovpn/ccd.conf", \%ccdconfhash);
|
||||||
foreach my $key (keys %ccdconfhash) {
|
foreach my $key (keys %ccdconfhash) {
|
||||||
if ($ccdconfhash{$key}[0] eq $oldname) {
|
if ($ccdconfhash{$key}[0] eq $oldname) {
|
||||||
|
|||||||
Reference in New Issue
Block a user