Skip to content

Commit

Permalink
Merge pull request #22 from doktornotor/patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
jim-p committed Dec 10, 2015
2 parents ef43b24 + 417f8b6 commit 2cca238
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 44 deletions.
2 changes: 1 addition & 1 deletion security/pfSense-pkg-openvpn-client-export/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# $FreeBSD$

PORTNAME= pfSense-pkg-openvpn-client-export
PORTVERSION= 1.3.4
PORTVERSION= 1.3.5
CATEGORIES= security
MASTER_SITES= # empty
DISTFILES= # empty
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,6 @@ global $current_openvpn_version, $current_openvpn_version_rev;
$current_openvpn_version = "2.3.8";
$current_openvpn_version_rev = "01";

function openvpn_client_export_install() {
global $current_openvpn_version;

$pfs_version = substr(trim(file_get_contents("/etc/version")),0,3);
if ($pfs_version == "2.1" || $pfs_version == "2.2") {
conf_mount_rw();
$tarpath = "/usr/local/pkg/openvpn-client-export-{$current_openvpn_version}.tgz";
$ovpndir = "/usr/local/share/openvpn";
$workdir = "{$ovpndir}/client-export";

if (!is_dir($workdir)) {
mkdir($workdir, 0777, true);
}
exec("/usr/bin/tar zxf {$tarpath} -C {$ovpndir}");
conf_mount_ro();
}
}

function openvpn_client_export_deinstall() {
exec("/bin/rm -r /usr/local/share/openvpn/client-export");
}
Expand Down Expand Up @@ -176,7 +158,6 @@ function openvpn_client_export_validate_config($srvid, $usrid, $crtid) {

function openvpn_client_export_config($srvid, $usrid, $crtid, $useaddr, $verifyservercn, $randomlocalport, $usetoken, $nokeys = false, $proxy, $expformat = "baseconf", $outpass = "", $skiptls = false, $doslines = false, $openvpnmanager, $advancedoptions = "") {
global $config, $input_errors, $g;
$pfs_version = substr(trim(file_get_contents("/etc/version")), 0, 3);

$nl = ($doslines) ? "\r\n" : "\n";
$conf = "";
Expand Down Expand Up @@ -343,11 +324,7 @@ EOF;

// add optional settings
if (!empty($settings['compression'])) {
if ($pfs_version > 2.1) {
$conf .= "comp-lzo {$settings['compression']}{$nl}";
} else {
$conf .= "comp-lzo{$nl}";
}
$conf .= "comp-lzo {$settings['compression']}{$nl}";
}

if ($settings['passtos']) {
Expand Down Expand Up @@ -527,9 +504,6 @@ function openvpn_client_export_installer($srvid, $usrid, $crtid, $useaddr, $veri

$ovpndir = "/usr/local/share/openvpn";
$workdir = "{$ovpndir}/client-export";
if (!file_exists($workdir . "/template/{$client_install_exe}")) {
openvpn_client_export_install();
}

$validconfig = openvpn_client_export_validate_config($srvid, $usrid, $crtid);
if ($validconfig) {
Expand Down Expand Up @@ -638,10 +612,6 @@ function viscosity_openvpn_client_config_exporter($srvid, $usrid, $crtid, $usead
$uname_p = trim(exec("uname -p"));

$ovpndir = "/usr/local/share/openvpn/";
if (!file_exists($workdir . "/template/openvpn-install.exe")) {
openvpn_client_export_install();
}

$uniq = uniqid();
$tempdir = $g['tmp_path'] . "/openvpn-export-" . $uniq;
$zipfile = $g['tmp_path'] . "/{$uniq}-Viscosity.visc.zip";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
]]>
</copyright>
<name>OpenVPN Client Export</name>
<version>1.3.4</version>
<version>1.3.5</version>
<title>OpenVPN Client Export</title>
<include_file>/usr/local/pkg/openvpn-client-export.inc</include_file>
<tabs>
Expand Down Expand Up @@ -80,9 +80,6 @@
<prefix>/etc/inc/priv/</prefix>
<item>https://packages.pfsense.org/packages/config/openvpn-client-export/openvpnexport.inc</item>
</additional_files_needed>
<custom_php_install_command>
openvpn_client_export_install();
</custom_php_install_command>
<custom_php_deinstall_command>
openvpn_client_export_deinstall();
</custom_php_deinstall_command>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,9 @@
<internal_name>openvpn-client-export</internal_name>
<descr><![CDATA[Allows a pre-configured OpenVPN Windows Client or Mac OS X's Viscosity configuration bundle to be exported directly from pfSense.]]></descr>
<category>Security</category>
<depends_on_package_pbi>zip-3.0_1-##ARCH##.pbi p7zip-9.20.1_2-##ARCH##.pbi</depends_on_package_pbi>
<build_port_path>/usr/ports/archivers/p7zip</build_port_path>
<build_port_path>/usr/ports/archivers/zip</build_port_path>
<port_category>security</port_category>
<run_depends>share/openvpn/client-export/template/config-import:security/openvpn-client-export bin/zip:archivers/zip bin/7z:archivers/p7zip</run_depends>
<version>1.3.4</version>
<version>1.3.5</version>
<status>RELEASE</status>
<required_version>2.2</required_version>
<config_file>https://packages.pfsense.org/packages/config/openvpn-client-export/openvpn-client-export.xml</config_file>
<required_version>2.3</required_version>
<configurationfile>openvpn-client-export.xml</configurationfile>
</package>
</pfsensepkgs>

0 comments on commit 2cca238

Please sign in to comment.