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
197303ad
Commit
197303ad
authored
Jul 31, 2015
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src: fix recent crash reports
parent
220a27e3
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
37 additions
and
29 deletions
+37
-29
openvpn.inc
src/etc/inc/openvpn.inc
+18
-10
legacy.inc
src/etc/inc/xmlrpc/legacy.inc
+11
-12
firewall_nat_edit.php
src/www/firewall_nat_edit.php
+1
-1
firewall_rules_edit.php
src/www/firewall_rules_edit.php
+1
-1
firewall_virtual_ip.php
src/www/firewall_virtual_ip.php
+2
-1
interfaces_groups.php
src/www/interfaces_groups.php
+2
-1
openvpn_wizard.inc
src/www/wizards/openvpn_wizard.inc
+2
-3
No files found.
src/etc/inc/openvpn.inc
View file @
197303ad
...
...
@@ -71,11 +71,12 @@ $openvpn_compression_modes = array(
'adaptive'
=>
gettext
(
"Enabled with Adaptive Compression"
),
'yes'
=>
gettext
(
"Enabled without Adaptive Compression"
));
function
openvpn_create_key
()
{
function
openvpn_create_key
()
{
$fp
=
popen
(
"/usr/local/sbin/openvpn --genkey --secret /dev/stdout 2>/dev/null"
,
"r"
);
if
(
!
$fp
)
if
(
!
$fp
)
{
return
false
;
}
$rslt
=
stream_get_contents
(
$fp
);
pclose
(
$fp
);
...
...
@@ -83,18 +84,25 @@ function openvpn_create_key() {
return
$rslt
;
}
function
openvpn_vpnid_used
(
$vpnid
)
{
function
openvpn_vpnid_used
(
$vpnid
)
{
global
$config
;
if
(
is
_array
(
$config
[
'openvpn'
][
'openvpn-server'
]))
foreach
(
$config
[
'openvpn'
][
'openvpn-server'
]
as
&
$settings
)
if
(
$vpnid
==
$settings
[
'vpnid'
])
if
(
is
set
(
$config
[
'openvpn'
][
'openvpn-server'
]))
{
foreach
(
$config
[
'openvpn'
][
'openvpn-server'
]
as
&
$settings
)
{
if
(
$vpnid
==
$settings
[
'vpnid'
])
{
return
true
;
}
}
}
if
(
is
_array
(
$config
[
'openvpn'
][
'openvpn-client'
]))
foreach
(
$config
[
'openvpn'
][
'openvpn-client'
]
as
&
$settings
)
if
(
$vpnid
==
$settings
[
'vpnid'
])
if
(
is
set
(
$config
[
'openvpn'
][
'openvpn-client'
]))
{
foreach
(
$config
[
'openvpn'
][
'openvpn-client'
]
as
&
$settings
)
{
if
(
$vpnid
==
$settings
[
'vpnid'
])
{
return
true
;
}
}
}
return
false
;
}
...
...
src/etc/inc/xmlrpc/legacy.inc
View file @
197303ad
...
...
@@ -260,14 +260,13 @@ function restore_config_section_xmlrpc($new_config)
$vipbackup
=
array
();
$oldvips
=
array
();
if
(
isset
(
$new_config
[
'virtualip'
]))
{
if
(
isset
(
$config
[
'virtualip'
][
'vip'
]))
{
foreach
(
$config
[
'virtualip'
][
'vip'
]
as
$vipindex
=>
$vip
)
{
if
(
$vip
[
'mode'
]
==
"carp"
)
if
(
$vip
[
'mode'
]
==
"carp"
)
{
$oldvips
[
"
{
$vip
[
'interface'
]
}
_vip
{
$vip
[
'vhid'
]
}
"
]
=
"
{
$vip
[
'password'
]
}{
$vip
[
'advskew'
]
}{
$vip
[
'subnet'
]
}{
$vip
[
'subnet_bits'
]
}{
$vip
[
'advbase'
]
}
"
;
else
if
(
$vip
[
'mode'
]
==
"ipalias"
&&
(
strstr
(
$vip
[
'interface'
],
"_vip"
)
||
strstr
(
$vip
[
'interface'
],
"lo0"
)))
}
elseif
(
$vip
[
'mode'
]
==
"ipalias"
&&
(
strstr
(
$vip
[
'interface'
],
"_vip"
)
||
strstr
(
$vip
[
'interface'
],
"lo0"
)))
{
$oldvips
[
$vip
[
'subnet'
]]
=
"
{
$vip
[
'interface'
]
}{
$vip
[
'subnet'
]
}{
$vip
[
'subnet_bits'
]
}
"
;
else
if
((
$vip
[
'mode'
]
==
"ipalias"
||
$vip
[
'mode'
]
==
'proxyarp'
)
&&
!
(
strstr
(
$vip
[
'interface'
],
"_vip"
)
||
strstr
(
$vip
[
'interface'
],
"lo0"
)))
}
elseif
((
$vip
[
'mode'
]
==
"ipalias"
||
$vip
[
'mode'
]
==
'proxyarp'
)
&&
!
(
strstr
(
$vip
[
'interface'
],
"_vip"
)
||
strstr
(
$vip
[
'interface'
],
"lo0"
)))
{
$vipbackup
[]
=
$vip
;
}
}
...
...
@@ -278,10 +277,10 @@ function restore_config_section_xmlrpc($new_config)
/* Then add ipalias and proxyarp types already defined on the backup */
if
(
is_array
(
$vipbackup
)
&&
!
empty
(
$vipbackup
))
{
if
(
!
is
_array
(
$config
[
'virtualip'
]))
{
if
(
!
is
set
(
$config
[
'virtualip'
]))
{
$config
[
'virtualip'
]
=
array
();
}
if
(
!
is
_array
(
$config
[
'virtualip'
][
'vip'
]))
{
if
(
!
is
set
(
$config
[
'virtualip'
][
'vip'
]))
{
$config
[
'virtualip'
][
'vip'
]
=
array
();
}
foreach
(
$vipbackup
as
$vip
)
{
...
...
@@ -298,7 +297,7 @@ function restore_config_section_xmlrpc($new_config)
* The real work on handling the vips specially
* This is a copy of intefaces_vips_configure with addition of not reloading existing/not changed carps
*/
if
(
isset
(
$new_config
[
'virtualip'
]
)
&&
is_array
(
$config
[
'virtualip'
])
&&
is_array
(
$config
[
'virtualip'
]
[
'vip'
]))
{
if
(
isset
(
$new_config
[
'virtualip'
][
'vip'
]))
{
$carp_setuped
=
false
;
$anyproxyarp
=
false
;
foreach
(
$config
[
'virtualip'
][
'vip'
]
as
$vip
)
{
...
...
src/www/firewall_nat_edit.php
View file @
197303ad
...
...
@@ -747,7 +747,7 @@ include("head.inc");
<?php
endif
;
?>
<?php
endforeach
;
?>
<?php
if
(
is
_array
(
$config
[
'virtualip'
][
'vip'
]))
:
<?php
if
(
is
set
(
$config
[
'virtualip'
][
'vip'
]))
:
foreach
(
$config
[
'virtualip'
][
'vip'
]
as
$sn
)
:
if
(
isset
(
$sn
[
'noexpand'
]))
continue
;
...
...
src/www/firewall_rules_edit.php
View file @
197303ad
...
...
@@ -282,7 +282,7 @@ if ($_POST) {
}
if
((
$_POST
[
'ipprotocol'
]
<>
""
)
&&
(
$_POST
[
'gateway'
]
<>
""
))
{
if
(
is_array
(
$config
[
'gateways'
][
'gateway_group'
]))
{
if
(
isset
(
$config
[
'gateways'
][
'gateway_group'
]))
{
foreach
(
$config
[
'gateways'
][
'gateway_group'
]
as
$gw_group
)
{
if
(
$gw_group
[
'name'
]
==
$_POST
[
'gateway'
])
{
$family
=
$a_gatewaygroups
[
$_POST
[
'gateway'
]][
'ipprotocol'
];
...
...
src/www/firewall_virtual_ip.php
View file @
197303ad
...
...
@@ -33,9 +33,10 @@ require_once("guiconfig.inc");
require_once
(
"interfaces.inc"
);
require_once
(
"filter.inc"
);
if
(
!
is
_array
(
$config
[
'virtualip'
][
'vip'
]))
{
if
(
!
is
set
(
$config
[
'virtualip'
][
'vip'
]))
{
$config
[
'virtualip'
][
'vip'
]
=
array
();
}
$a_vip
=
&
$config
[
'virtualip'
][
'vip'
];
if
(
$_POST
)
{
...
...
src/www/interfaces_groups.php
View file @
197303ad
...
...
@@ -30,8 +30,9 @@
require_once
(
"guiconfig.inc"
);
require_once
(
"interfaces.inc"
);
if
(
!
is
_array
(
$config
[
'ifgroups'
][
'ifgroupentry'
]))
if
(
!
is
set
(
$config
[
'ifgroups'
][
'ifgroupentry'
]))
{
$config
[
'ifgroups'
][
'ifgroupentry'
]
=
array
();
}
$a_ifgroups
=
&
$config
[
'ifgroups'
][
'ifgroupentry'
];
...
...
src/www/wizards/openvpn_wizard.inc
View file @
197303ad
...
...
@@ -660,8 +660,9 @@ function step12_submitphpaction() {
$config
[
'filter'
][
'rule'
][]
=
$rule
;
}
if
(
!
is
_array
(
$config
[
'openvpn'
][
'openvpn-server'
]))
if
(
!
is
set
(
$config
[
'openvpn'
][
'openvpn-server'
]))
{
$config
[
'openvpn'
][
'openvpn-server'
]
=
array
();
}
$config
[
'openvpn'
][
'openvpn-server'
][]
=
$server
;
...
...
@@ -670,5 +671,3 @@ function step12_submitphpaction() {
header
(
"Location: vpn_openvpn_server.php"
);
exit
;
}
?>
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