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
5044756b
Commit
5044756b
authored
Dec 21, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
system: extend sudo usage for no password mode
(cherry picked from commit
041681ba
)
parent
322348b1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
sudoers
src/opnsense/service/templates/OPNsense/Auth/sudoers
+2
-0
system_advanced_admin.php
src/www/system_advanced_admin.php
+8
-5
No files found.
src/opnsense/service/templates/OPNsense/Auth/sudoers
View file @
5044756b
{% if system.sudo_allow_wheel|default('0') == '1' %}
%wheel ALL=(ALL) ALL
{% elif system.sudo_allow_wheel|default('0') == '2' %}
%wheel ALL=(ALL) NOPASSWD: ALL
{% endif %}
src/www/system_advanced_admin.php
View file @
5044756b
...
...
@@ -41,7 +41,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$pconfig
[
'ssl-certref'
]
=
$config
[
'system'
][
'webgui'
][
'ssl-certref'
];
$pconfig
[
'disablehttpredirect'
]
=
isset
(
$config
[
'system'
][
'webgui'
][
'disablehttpredirect'
]);
$pconfig
[
'disableconsolemenu'
]
=
isset
(
$config
[
'system'
][
'disableconsolemenu'
]);
$pconfig
[
'sudo_allow_wheel'
]
=
isset
(
$config
[
'system'
][
'sudo_allow_wheel'
])
;
$pconfig
[
'sudo_allow_wheel'
]
=
$config
[
'system'
][
'sudo_allow_wheel'
]
;
$pconfig
[
'noantilockout'
]
=
isset
(
$config
[
'system'
][
'webgui'
][
'noantilockout'
]);
$pconfig
[
'nodnsrebindcheck'
]
=
isset
(
$config
[
'system'
][
'webgui'
][
'nodnsrebindcheck'
]);
$pconfig
[
'nohttpreferercheck'
]
=
isset
(
$config
[
'system'
][
'webgui'
][
'nohttpreferercheck'
]);
...
...
@@ -114,8 +114,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
unset
(
$config
[
'system'
][
'disableconsolemenu'
]);
}
if
(
$pconfig
[
'sudo_allow_wheel'
]
==
"yes"
)
{
$config
[
'system'
][
'sudo_allow_wheel'
]
=
true
;
if
(
!
empty
(
$pconfig
[
'sudo_allow_wheel'
])
)
{
$config
[
'system'
][
'sudo_allow_wheel'
]
=
$pconfig
[
'sudo_allow_wheel'
]
;
}
elseif
(
isset
(
$config
[
'system'
][
'sudo_allow_wheel'
]))
{
unset
(
$config
[
'system'
][
'sudo_allow_wheel'
]);
}
...
...
@@ -553,8 +553,11 @@ include("head.inc");
<tr>
<td><i
class=
"fa fa-info-circle text-muted"
></i>
<?=
gettext
(
"Sudo usage"
)
?>
</td>
<td
width=
"78%"
>
<input
name=
"sudo_allow_wheel"
type=
"checkbox"
value=
"yes"
<?=
empty
(
$pconfig
[
'sudo_allow_wheel'
])
?
''
:
'checked="checked"'
?>
/>
<strong>
<?=
gettext
(
'Allow administrators to use the Sudo utility'
)
?>
</strong>
<select
name=
"sudo_allow_wheel"
id=
"sudo_allow_wheel"
class=
"formselect selectpicker"
>
<option
value=
""
<?=
empty
(
$pconfig
[
'sudo_allow_wheel'
])
?
'selected="selected"'
:
''
?>
>
<?=
gettext
(
'Disallow'
)
?>
</option>
<option
value=
"1"
<?=
$pconfig
[
'sudo_allow_wheel'
]
==
1
?
'selected="selected"'
:
''
?>
>
<?=
gettext
(
'Ask password'
)
?>
</option>
<option
value=
"2"
<?=
$pconfig
[
'sudo_allow_wheel'
]
==
2
?
'selected="selected"'
:
''
?>
>
<?=
gettext
(
'No password'
)
?>
</option>
</select>
</td>
</tr>
<tr>
...
...
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