Commit 89169102 authored by Franco Fichtner's avatar Franco Fichtner Committed by GitHub

Merge pull request #1010 from fabianfrz/fix_914

created a fix for 914 (openvpn-client-export.inc)
parents 39406886 bd20f935
...@@ -134,8 +134,7 @@ CORE_DEPENDS?= apinger \ ...@@ -134,8 +134,7 @@ CORE_DEPENDS?= apinger \
suricata \ suricata \
syslogd \ syslogd \
unbound \ unbound \
wol \ wol
zip
WRKDIR?=${.CURDIR}/work WRKDIR?=${.CURDIR}/work
WRKSRC= ${WRKDIR}/src WRKSRC= ${WRKDIR}/src
......
...@@ -368,7 +368,7 @@ function openvpn_client_export_config($srvid, $usrid, $crtid, $useaddr, $verifys ...@@ -368,7 +368,7 @@ function openvpn_client_export_config($srvid, $usrid, $crtid, $useaddr, $verifys
} }
} }
$command = "cd " . escapeshellarg("{$tempdir}/..") $command = "cd " . escapeshellarg("{$tempdir}/..")
. " && /usr/local/bin/zip -r " . " && /usr/local/bin/7z -tzip -y -r a "
. escapeshellarg("/tmp/{$prefix}-config.zip") . escapeshellarg("/tmp/{$prefix}-config.zip")
. " " . escapeshellarg($prefix); . " " . escapeshellarg($prefix);
exec($command); exec($command);
...@@ -678,7 +678,7 @@ EOF; ...@@ -678,7 +678,7 @@ EOF;
} }
// Zip Viscosity file // Zip Viscosity file
exec("cd {$tempdir}/.. && /usr/local/bin/zip -r {$zipfile} Viscosity.visc"); exec("cd {$tempdir}/.. && /usr/local/bin/7z -tzip -y -r a {$zipfile} Viscosity.visc");
// Remove temporary directory // Remove temporary directory
exec("rm -rf {$tempdir}"); exec("rm -rf {$tempdir}");
...@@ -805,7 +805,7 @@ function openvpn_client_export_sharedkey_config($srvid, $useaddr, $proxy, $zipco ...@@ -805,7 +805,7 @@ function openvpn_client_export_sharedkey_config($srvid, $useaddr, $proxy, $zipco
$shkeyfile = "{$tempdir}/{$shkeyfile}"; $shkeyfile = "{$tempdir}/{$shkeyfile}";
file_put_contents("{$shkeyfile}", base64_decode($settings['shared_key'])); file_put_contents("{$shkeyfile}", base64_decode($settings['shared_key']));
exec("cd {$tempdir}/.. && /usr/local/bin/zip -r /tmp/{$prefix}-config.zip {$prefix}"); exec("cd {$tempdir}/.. && /usr/local/bin/7z -tzip -y -r a /tmp/{$prefix}-config.zip {$prefix}");
// Remove temporary directory // Remove temporary directory
exec("rm -rf {$tempdir}"); exec("rm -rf {$tempdir}");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment