Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
92d7bce2
Commit
92d7bce2
authored
Dec 18, 2016
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(openvpn export) make sure we remove the top level temp dir for Viscosity exports
parent
41b9d3fe
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
8 deletions
+3
-8
vpn_openvpn_export.php
src/www/vpn_openvpn_export.php
+3
-8
No files found.
src/www/vpn_openvpn_export.php
View file @
92d7bce2
...
...
@@ -464,9 +464,6 @@ function viscosity_openvpn_client_config_exporter($srvid, $usrid, $crtid, $usead
{
global
$config
;
$uniq
=
uniqid
();
$tempdir
=
"/tmp/openvpn-export-
{
$uniq
}
"
;
$validconfig
=
openvpn_client_export_validate_config
(
$srvid
,
$usrid
,
$crtid
);
if
(
!
$validconfig
)
{
return
false
;
...
...
@@ -475,11 +472,9 @@ function viscosity_openvpn_client_config_exporter($srvid, $usrid, $crtid, $usead
list
(
$settings
,
$server_cert
,
$server_ca
,
$servercn
,
$user
,
$cert
,
$nokeys
)
=
$validconfig
;
// create template directory
$baseTempDir
=
"/tmp/openvpn-export-"
.
uniqid
();
$tempdir
=
$baseTempDir
.
"/Viscosity.visc"
;
mkdir
(
$tempdir
,
0700
,
true
);
mkdir
(
$tempdir
.
"/Viscosity.visc"
,
0700
,
true
);
// Append new Viscosity.visc directory on top
$tempdir
=
$tempdir
.
"/Viscosity.visc/"
;
// write cofiguration file
$prefix
=
openvpn_client_export_prefix
(
$srvid
,
$usrid
,
$crtid
);
...
...
@@ -570,7 +565,7 @@ EOF;
}
// Remove temporary directory
exec
(
"rm -rf
{
$
tempd
ir
}
"
);
exec
(
"rm -rf
{
$
baseTempD
ir
}
"
);
return
$outputfile
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment