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:
Alexander Marx
2013-01-07 08:46:42 +01:00
committed by Michael Tremer
parent 1d109fd2a6
commit b643120c01
2 changed files with 2 additions and 0 deletions

View File

@@ -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'){

View File

@@ -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";