| Server IP : 89.117.53.150 / Your IP : 216.73.216.11 Web Server : Apache System : Linux server2.hostofiraq.site 5.15.0-186-generic #196-Ubuntu SMP Sat Jun 20 16:09:34 UTC 2026 x86_64 User : iscmbt-kufa-atu ( 1014) PHP Version : 8.2.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/share/webmin/grub2/ |
Upload File : |
#!/usr/bin/perl
# Save GRUB 2 password protection settings.
use strict;
use warnings;
require './grub2-lib.pl'; ## no critic
our (%in, %text);
&ReadParse();
&error_setup($text{'security_err'});
my %access = &get_module_acl();
&error("$text{'eacl_np'} $text{'eacl_psecurity'}") if (!$access{'security'});
# The enable flag is deliberately boolean; all other fields normalize below.
defined($in{'enabled'}) && $in{'enabled'} =~ /^[01]\z/ ||
&error($text{'security_err'});
foreach my $field (qw(user password password2 hash)) {
$in{$field} = "" if (!defined($in{$field}));
}
$in{'hash'} =~ s/^\s+|\s+\z//g;
# Read current state so disabling an existing script still triggers regenerate.
my $current = &grub2_read_security_config();
my $err = &grub2_save_security_config({
'enabled' => $in{'enabled'},
'user' => $in{'user'},
'password' => $in{'password'},
'password2' => $in{'password2'},
'hash' => $in{'hash'},
});
&error($err) if ($err);
# A changed password script is included by grub-mkconfig, so refresh the menu.
&grub2_mark_regenerate_needed()
if ($in{'enabled'} || $current->{'exists'});
&webmin_log("security", undef, $in{'enabled'} ? "enabled" : "disabled");
&redirect("index.cgi");