aboutsummaryrefslogtreecommitdiffstats
path: root/config/openvpn-client-export/openvpn-client-export.inc
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2013-07-14 14:20:06 -0400
committerjim-p <jimp@pfsense.org>2013-07-14 14:20:06 -0400
commit5bb3bd5007f0c9b14b077e85b686aa7950d27963 (patch)
treeeb12760af5fbc7c49baa9cefc41dbdb52b0da3f0 /config/openvpn-client-export/openvpn-client-export.inc
parentbce84876eee8032f24f99ca6b72bc5d68da7511e (diff)
downloadpfsense-packages-5bb3bd5007f0c9b14b077e85b686aa7950d27963.tar.gz
pfsense-packages-5bb3bd5007f0c9b14b077e85b686aa7950d27963.tar.bz2
pfsense-packages-5bb3bd5007f0c9b14b077e85b686aa7950d27963.zip
Replace spaces in a CN with _ in filenames when exporting an OpenVPN client. Also only use a CN if there isn't a username to use instead. Unbreaks Windows Installer export with spaces in CN.
Diffstat (limited to 'config/openvpn-client-export/openvpn-client-export.inc')
-rwxr-xr-xconfig/openvpn-client-export/openvpn-client-export.inc4
1 files changed, 2 insertions, 2 deletions
diff --git a/config/openvpn-client-export/openvpn-client-export.inc b/config/openvpn-client-export/openvpn-client-export.inc
index b2c240ec..ac006d20 100755
--- a/config/openvpn-client-export/openvpn-client-export.inc
+++ b/config/openvpn-client-export/openvpn-client-export.inc
@@ -78,8 +78,8 @@ function openvpn_client_export_prefix($srvid, $usrid = null, $crtid = null) {
$filename_addition = "";
if ($usrid && is_numeric($usrid))
$filename_addition = "-".$config['system']['user'][$usrid]['name'];
- if ($crtid && is_numeric($crtid) && function_exists("cert_get_cn"))
- $filename_addition = "-".cert_get_cn($config['cert'][$crtid]['crt']);
+ elseif ($crtid && is_numeric($crtid) && function_exists("cert_get_cn"))
+ $filename_addition = "-" . str_replace(' ', '_', cert_get_cn($config['cert'][$crtid]['crt']));
return "{$host}-{$prot}-{$port}{$filename_addition}";
}