HEX
Server: Apache/2.4.29 (Ubuntu)
System: Linux bareserver 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
User: root (0)
PHP: 7.2.24-0ubuntu0.18.04.17
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: //usr/share/webmin/grub/save_global.cgi
#!/usr/bin/perl
# save_global.cgi
# Save global GRUB options

require './grub-lib.pl';
&ReadParse();
&error_setup($text{'global_err'});
&lock_file($config{'menu_file'});
$conf = &get_menu_config();
&error_setup($text{'global_err'});

# validate and save inputs
if ($in{'default'} eq '') {
	&save_directive($conf, 'default', undef);
	}
else {
	&save_directive($conf, 'default', { 'name' => 'default',
					    'value' => $in{'default'} });
	}
if ($in{'fallback'} eq '') {
	&save_directive($conf, 'fallback', undef);
	}
else {
	&save_directive($conf, 'fallback', { 'name' => 'fallback',
					     'value' => $in{'fallback'} });
	}
if ($in{'timeout_def'}) {
	&save_directive($conf, 'timeout', undef);
	}
else {
	$in{'timeout'} =~ /^\d+$/ || &error($text{'global_etimeout'});
	&save_directive($conf, 'timeout', { 'name' => 'timeout',
					    'value' => $in{'timeout'} });
	}
if ($in{'password_def'}) {
	&save_directive($conf, 'password', undef);
	}
else {
	$in{'password'} =~ /^\S+$/ || &error($text{'global_epassword'});
	if (!$in{'password_file'}) {
		&save_directive($conf, 'password', { 'name' => 'password',
		    'value' => $in{'password'} } );
		}
	else {
		$in{'password_filename'} =~ /^\S+$/ ||
			&error($text{'global_epasswordfile'});
		&save_directive($conf, 'password', { 'name' => 'password',
		    'value' => $in{'password'}.' '.$in{'password_filename'} } );
		}
	}
if ($in{'install_mode'} == 1) {
	$install = &linux_to_bios($in{'install'});
	$install || &error(&text('global_edev', $in{'root'}));
	$config{'install'} = $install;
	}
else {
	$in{'other'} =~ /^\S+$/ || &error($text{'global_eother'});
	$config{'install'} = $in{'other'};
	}
&write_file("$module_config_directory/config", \%config);
&flush_file_lines($config{'menu_file'});
&unlock_file($config{'menu_file'});
&webmin_log("global");
&redirect("");