mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-21 08:22:59 +02:00
OpenVPN CCD: Fix ccd filename when certificate has spaces in name. Now the filename gets an underscore to provide full functionality of openvpn.
This commit is contained in:
committed by
Michael Tremer
parent
1d109fd2a6
commit
b643120c01
@@ -3980,6 +3980,7 @@ if ($cgiparams{'TYPE'} eq 'net') {
|
||||
if ( -e "${General::swroot}/ovpn/ccd/$confighash{$key}[2]"){
|
||||
unlink "${General::swroot}/ovpn/ccd/$cgiparams{'CERT_NAME'}";
|
||||
}
|
||||
$confighash{$key}[2] =~ s/ /_/gi;
|
||||
open ( CCDRWCONF,'>',"${General::swroot}/ovpn/ccd/$confighash{$key}[2]") or die "Unable to create clientconfigfile $!";
|
||||
print CCDRWCONF "# OpenVPN clientconfig from ccd extension by Copymaster#\n\n";
|
||||
if($cgiparams{'CHECK1'} eq 'dynamic'){
|
||||
|
||||
@@ -31,6 +31,7 @@ open(FILE,"/var/ipfire/ovpn/server.conf");
|
||||
&General::readhasharray("/var/ipfire/ovpn/ovpnconfig", \%ovpnconfig);
|
||||
foreach my $key (keys %ovpnconfig){
|
||||
if($ovpnconfig{$key}[32] eq '' && $ovpnconfig{$key}[3] eq 'host'){
|
||||
$ovpnconfig{$key}[2] =~ s/ /_/gi;
|
||||
open ( CCDRWCONF,'>',"/var/ipfire/ovpn/ccd/$ovpnconfig{$key}[2]") or die "Unable to create clientconfigfile $!";
|
||||
print CCDRWCONF "# OpenVPN Clientconfig from CCD extension by Copymaster#\n\n";
|
||||
print CCDRWCONF "#This client uses the dynamic pool\n\n";
|
||||
|
||||
Reference in New Issue
Block a user