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
57bb583c
Commit
57bb583c
authored
Aug 12, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
interfaces: add missing validation for previous #1052
parent
e86885cb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
interfaces.inc
src/etc/inc/interfaces.inc
+2
-2
interfaces.php
src/www/interfaces.php
+9
-1
No files found.
src/etc/inc/interfaces.inc
View file @
57bb583c
...
...
@@ -3416,7 +3416,7 @@ function interface_dhcpv6_configure($interface = 'wan', $wancfg)
$dhcp6cconf
=
file_get_contents
(
$dhcp6cfile
);
$dhcp6cconf
=
DHCP6_Config_File_Substitutions
(
$wancfg
,
$wanif
,
$dhcp6cconf
);
}
else
{
log_error
(
sprintf
(
'DHCP6 config file override does not exist:
%s
'
,
$dhcp6cfile
));
log_error
(
sprintf
(
'DHCP6 config file override does not exist:
"%s"
'
,
$dhcp6cfile
));
}
}
...
...
@@ -3739,7 +3739,7 @@ EOD;
$dhclientconf
=
file_get_contents
(
$dhclientfile
);
$dhclientconf
=
DHCP_Config_File_Substitutions
(
$wancfg
,
$wanif
,
$dhclientconf
);
}
else
{
log_error
(
sprintf
(
'DHCP config file override does not exist:
%s
'
,
$dhclientfile
));
log_error
(
sprintf
(
'DHCP config file override does not exist:
"%s"
'
,
$dhclientfile
));
}
}
...
...
src/www/interfaces.php
View file @
57bb583c
...
...
@@ -611,6 +611,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
if
(
in_array
(
$a_interfaces
[
$if
][
'ipaddr'
],
array
(
"ppp"
,
"pppoe"
,
"pptp"
,
"l2tp"
)))
{
$input_errors
[]
=
sprintf
(
gettext
(
"You have to reassign the interface to be able to configure as %s."
),
$pconfig
[
'type'
]);
}
if
(
!
empty
(
$pconfig
[
'adv_dhcp_config_file_override'
]
&&
!
file_exists
(
$pconfig
[
'adv_dhcp_config_file_override_path'
])))
{
$input_errors
[]
=
sprintf
(
gettext
(
'The DHCP override file "%s" does not exist.'
),
$pconfig
[
'adv_dhcp_config_file_override_path'
]);
}
break
;
case
"ppp"
:
$reqdfields
=
explode
(
" "
,
"ports phone"
);
...
...
@@ -654,6 +657,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$reqdfieldsn
=
array
(
gettext
(
"IPv6 address"
),
gettext
(
"Subnet bit count"
),
gettext
(
"Gateway"
));
do_input_validation
(
$pconfig
,
$reqdfields
,
$reqdfieldsn
,
$input_errors
);
break
;
case
"dhcp6"
:
if
(
!
empty
(
$pconfig
[
'adv_dhcp6_config_file_override'
]
&&
!
file_exists
(
$pconfig
[
'adv_dhcp6_config_file_override_path'
])))
{
$input_errors
[]
=
sprintf
(
gettext
(
'The DHCPv6 override file "%s" does not exist.'
),
$pconfig
[
'adv_dhcp6_config_file_override_path'
]);
}
break
;
case
"none"
:
if
(
isset
(
$config
[
'virtualip'
][
'vip'
]))
{
foreach
(
$config
[
'virtualip'
][
'vip'
]
as
$vip
)
{
...
...
@@ -2046,7 +2054,7 @@ include("head.inc");
</td>
</tr>
<tr
class=
"dhcp_file_override"
>
<td><a
id=
"help_for_dhcp_config_file_override_path"
href=
"#"
class=
"showhelp"
><i
class=
"fa fa-info-circle"
></i></a>
<?=
gettext
(
"Config
File Override"
);
?>
<td><a
id=
"help_for_dhcp_config_file_override_path"
href=
"#"
class=
"showhelp"
><i
class=
"fa fa-info-circle"
></i></a>
<?=
gettext
(
"Configuration
File Override"
);
?>
<td>
<input
name=
"adv_dhcp_config_file_override_path"
type=
"text"
id=
"adv_dhcp_config_file_override_path"
value=
"
<?=
$pconfig
[
'adv_dhcp_config_file_override_path'
];
?>
"
/>
<div
class=
"hidden"
for=
"help_for_dhcp_config_file_override_path"
>
...
...
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