Compare commits

..

1 Commits

31 changed files with 66 additions and 3524 deletions

View File

@@ -1,12 +1,7 @@
## Changelog
#### 2.102 (August 23, 2023)
#### 2.102 (August, 2023)
* Add support for Amazon Linux 2023
* Fix a bug in Network Configuration module when parsing network size [sourceforge.net/discussion#55377]( https://sourceforge.net/p/webadmin/discussion/55377/thread/78e5aa05f3)
* Fix Netplan related bugs in Network Configuration module
* Fix Terminal focus bug
* Fix to correctly compare Webmin semantic versions
* Fix to suppress output from `monitor.pl` command [#1984](https://github.com/webmin/webmin/issues/1984)
#### 2.101 (August 5, 2023)
* Add support for reading gzipped email messages

View File

@@ -2,7 +2,7 @@
# Returns a list of files and directories under some directory
$trust_unknown_referers = 1;
require './bacula-backup-lib.pl';
BEGIN { require './bacula-backup-lib.pl'; }
&ReadParse();
# Input sanitization

View File

@@ -120,7 +120,7 @@ if (@filters || &get_global_spamassassin()) {
# Work out nice condition and action descriptions
local $cond;
($cond, $lastalways) = &describe_condition($f);
$cond = &ui_link("edit.cgi?idx=$f->{'index'}", $cond);
$cond = &ui_link("edit.cgi?idx=$f->{'index'}", &html_escape($cond));
local $action = &describe_action($f, \@folders);
# Create mover links

View File

@@ -501,7 +501,18 @@ return $? ? $out : undef;
sub get_config_files
{
my $conf_dir = $config{'config_dir'} || '/etc/firewalld';
return (glob("$conf_dir/*.xml"), glob("$conf_dir/*/*.xml"));
my @conf_files;
my @dirpath = ($conf_dir);
eval "use File::Find;";
if (!$@) {
find(sub {
my $file = $File::Find::name;
push(@conf_files, $file)
if (-f $file && $file =~ /\.(conf|xml)$/);
}, @dirpath);
}
push(@conf_files, "$conf_dir/direct.xml");
return @conf_files;
}
1;

View File

@@ -458,6 +458,7 @@ foreach my $deb ("deb", "newkey/deb") {
# Run the actual build command
system("fakeroot dpkg --build $tmp_dir $deb/${product}_${ver}${rel}_all.deb") &&
die "dpkg failed";
#system("rm -rf $tmp_dir");
print "Wrote $deb/${product}_${ver}${rel}_all.deb\n";
$md5 = `md5sum $tarfile`;
$md5 =~ s/\s+.*\n//g;
@@ -520,8 +521,6 @@ EOF
unlink("sigs/${product}_${ver}${rel}_all.deb-sig.asc");
system("gpg --armor --output sigs/${product}_${ver}${rel}_all.deb-sig.asc --default-key $key --detach-sig $deb/${product}_${ver}${rel}_all.deb");
print "Wrote sigs/${product}_${ver}${rel}_all.deb-sig.asc\n";
system("rm -rf $diff_orig_dir $diff_new_dir");
}
# read_file(file, &assoc, [&order], [lowercase])

View File

@@ -1450,10 +1450,7 @@ alarm(0);
# If a remote IP is given in a header (such as via a proxy), only use it
# for logging unless trust_real_ip is set
local $headerhost = $header{'x-forwarded-for'} ||
$header{'x-real-ip'} ||
$header{'true-client-ip'} ||
$header{'cf-connecting-ip'} ||
$header{'cf-connecting-ip6'};
$header{'x-real-ip'};
if ($headerhost) {
# Only real IPs are allowed
$headerhost = undef if (!&check_ipaddress($headerhost) &&

View File

@@ -371,7 +371,7 @@ return &get_system_hostname();
sub save_hostname
{
&system_logged("hostname $_[0] >/dev/null 2>&1");
&get_system_hostname(undef, undef, 2); # clear cache
undef(@main::get_system_hostname); # clear cache
}
# get_domainname()

View File

@@ -583,7 +583,7 @@ if (&has_command("hostnamectl")) {
" >/dev/null 2>&1");
}
&get_system_hostname(undef, undef, 2); # clear cache
undef(@main::get_system_hostname); # clear cache
}
# get_domainname()

View File

@@ -583,7 +583,7 @@ my ($hostname) = @_;
&system_logged("hostname ".quotemeta($hostname)." >/dev/null 2>&1");
&save_rc_conf('hostname', $_[0]);
&unlock_file("/etc/rc.conf");
&get_system_hostname(undef, undef, 2); # clear cache
undef(@main::get_system_hostname); # clear cache
}
sub routing_config_files

View File

@@ -525,7 +525,7 @@ return &has_command("ifup") &&
$gconfig{'os_version'} >= 5 ||
$gconfig{'os_type'} eq 'redhat-linux' &&
$gconfig{'os_version'} >= 13) &&
($iface->{'name'} !~ /^(eth|em|eno|ens|enp|enx|enX|lo|br)/ ||
($iface->{'name'} !~ /^(eth|em|eno|ens|enp|enx|lo|br)/ ||
$iface->{'name'} =~ /^(\S+)\.(\d+)/) &&
$iface->{'virtual'} eq '';
}
@@ -541,7 +541,7 @@ if ($name =~ /^(.*)\.(\d+)$/) {
return "PPP" if ($name =~ /^ppp/);
return "SLIP" if ($name =~ /^sl/);
return "PLIP" if ($name =~ /^plip/);
return "Ethernet" if ($name =~ /^eth|em|eno|ens|enp|enx|enX|p\d+p\d+|vtnet/);
return "Ethernet" if ($name =~ /^eth|em|eno|ens|enp|enx|p\d+p\d+|vtnet/);
return "Wireless Ethernet" if ($name =~ /^(wlan|ath)/);
return "Arcnet" if ($name =~ /^arc/);
return "Token Ring" if ($name =~ /^tr/);
@@ -803,7 +803,7 @@ return $? ? $out : undef;
# Does some interface have an editable hardware address
sub iface_hardware
{
return $_[0] =~ /^(eth|em|eno|ens|enp|enx|enX)/;
return $_[0] =~ /^(eth|em|eno|ens|enp|enx)/;
}
# allow_interface_clash()

View File

@@ -396,7 +396,7 @@ my ($hostname) = @_;
&lock_file($hostconfig);
&set_hostconfig("HOSTNAME", $hostname);
&unlock_file($hostconfig);
&get_system_hostname(undef, undef, 2); # clear cache
undef(@main::get_system_hostname); # clear cache
}
sub routing_config_files

View File

@@ -437,7 +437,7 @@ if (&has_command("hostnamectl")) {
" >/dev/null 2>&1");
}
&get_system_hostname(undef, undef, 2); # clear cache
undef(@main::get_system_hostname); # clear cache
}
# get_domainname()

View File

@@ -334,7 +334,7 @@ if (&has_command("hostnamectl")) {
" >/dev/null 2>&1");
}
&get_system_hostname(undef, undef, 2); # clear cache
undef(@main::get_system_hostname); # clear cache
}
# get_domainname()

View File

@@ -131,7 +131,7 @@ local %conf;
$conf{'HOSTNAME'} = $_[0];
&write_file($network_config, \%conf);
&unlock_file($network_config);
&get_system_hostname(undef, undef, 2); # clear cache
undef(@main::get_system_hostname); # clear cache
}
# get_domainname()

View File

@@ -417,7 +417,7 @@ my ($hostname) = @_;
&open_lock_tempfile(MYNAME, ">/etc/myname");
&print_tempfile(MYNAME, $hostname,"\n");
&close_tempfile(MYNAME);
&get_system_hostname(undef, undef, 2); # clear cache
undef(@main::get_system_hostname); # clear cache
}
sub set_line {

View File

@@ -506,7 +506,7 @@ if (&has_command("hostnamectl")) {
" >/dev/null 2>&1");
}
&get_system_hostname(undef, undef, 2); # clear cache
undef(@main::get_system_hostname); # clear cache
}
# get_domainname()

View File

@@ -274,7 +274,7 @@ sub save_hostname
&open_lock_tempfile(HOST, ">/etc/HOSTNAME");
&print_tempfile(HOST, $_[0],"\n");
&close_tempfile(HOST);
&get_system_hostname(undef, undef, 2); # clear cache
undef(@main::get_system_hostname); # clear cache
}
sub routing_config_files

View File

@@ -236,7 +236,7 @@ sub save_hostname
&open_lock_tempfile(HOST, ">/etc/HOSTNAME");
&print_tempfile(HOST, $_[0],"\n");
&close_tempfile(HOST);
&get_system_hostname(undef, undef, 2); # clear cache
undef(@main::get_system_hostname); # clear cache
}
sub routing_config_files

View File

@@ -442,7 +442,7 @@ if (-r "/etc/nodename") {
&print_tempfile(NODENAME, $_[0],"\n");
&close_tempfile(NODENAME);
}
&get_system_hostname(undef, undef, 2); # clear cache
undef(@main::get_system_hostname); # clear cache
}
# get_domainname()

View File

@@ -172,7 +172,7 @@ local %conf;
&open_lock_tempfile(HOST, ">/etc/HOSTNAME");
&print_tempfile(HOST, $_[0],"\n");
&close_tempfile(HOST);
&get_system_hostname(undef, undef, 2); # clear cache
undef(@main::get_system_hostname); # clear cache
}
sub routing_config_files

View File

@@ -258,7 +258,7 @@ local %conf;
&open_lock_tempfile(HOST, ">/etc/HOSTNAME");
&print_tempfile(HOST, $_[0],"\n");
&close_tempfile(HOST);
&get_system_hostname(undef, undef, 2); # clear cache
undef(@main::get_system_hostname); # clear cache
}
sub routing_config_files

View File

@@ -200,7 +200,7 @@ local $rc = &parse_rc_config();
# run SuSEconfig, as this function is called last
&system_logged("SuSEconfig -quick >/dev/null 2>&1");
&get_system_hostname(undef, undef, 2); # clear cache
undef(@main::get_system_hostname); # clear cache
}
sub routing_config_files

View File

@@ -136,7 +136,7 @@ local %conf;
$conf{'HOSTNAME'} = $_[0];
&write_env_file($network_config, \%conf);
&unlock_file($network_config);
&get_system_hostname(undef, undef, 2); # clear cache
undef(@main::get_system_hostname); # clear cache
}
# get_domainname()

View File

@@ -314,7 +314,7 @@ return &get_system_hostname();
sub save_hostname
{
&system_logged("hostname $_[0] >/dev/null 2>&1");
&get_system_hostname(undef, undef, 2); # clear cache
undef(@main::get_system_hostname); # clear cache
}
# get_domainname()

View File

@@ -166,7 +166,7 @@ deb)
echo " .. done"
# Create repo file
echo " Setting up Webmin repository .."
echo "deb [signed-by=/usr/share/keyrings/$repoid_debian_like-$webmin_key_suffix.gpg] $webmin_download/download/newkey/repository stable contrib" >$debian_repo_file
echo "deb [signed-by=/usr/share/keyrings/$repoid_debian_like-$webmin_key_suffix.gpg] $webmin_download/download/repo webmin main" >$debian_repo_file
echo " .. done"
# Clean meta
echo " Cleaning repository metadata .."

File diff suppressed because it is too large Load Diff

View File

@@ -1 +1 @@
2.102
2.101

View File

@@ -1698,9 +1698,7 @@ $err_caller = "$stack[1]->[1] (line $stack[1]->[2])"
if ($stack[1]->[1] && $stack[1]->[2]);
if ($err_caller) {
$err_caller =~ s/$root_directory\///;
my $err_caller_ =
$main::webmin_script_type =~ /^(cmd|cron)$/ ?
$err_caller : &ui_help($err_caller);
my $err_caller_ = &ui_help($err_caller);
$msg = $msg ? "$msg $err_caller_" : $err_caller_;
push(@msg, $err_caller_);
}
@@ -4237,36 +4235,19 @@ my $func = "${pkg}::${sub}";
return defined(&$func);
}
=head2 get_system_hostname([short], [skip-file], [nocache])
=head2 get_system_hostname([short], [skip-file])
Returns the hostname of this system. If the short parameter is set to 1 then
the domain name is not prepended - otherwise, Webmin will attempt to get the
fully qualified hostname, like foo.example.com.
If the nocache parameter is set to 1 it will flush the cache and re-read the
hostname from the system. If the nocache parameter is set to 2 it will flush
the cache and exit.
Returns the hostname of this system. If the short parameter is set to 1,
then the domain name is not prepended - otherwise, Webmin will attempt to get
the fully qualified hostname, like foo.example.com.
=cut
sub get_system_hostname
{
my ($m , $skipfile, $nocache) = @_;
$m = int($m);
state @system_hostname;
undef(@system_hostname) if ($nocache);
return if ($nocache == 2);
if (!$system_hostname[$m]) {
my $m = int($_[0]);
my $skipfile = $_[1];
if (!$main::get_system_hostname[$m]) {
if ($gconfig{'os_type'} ne 'windows') {
# Try hostnamectl command on Linux
if (&has_command("hostnamectl")) {
my $hostname =
&backquote_command("hostnamectl --static");
chop($hostname);
if ($? == 0 && $hostname =~ /\./) {
$hostname =~ s/\..*$// if ($m);
$system_hostname[$m] = $hostname;
return $hostname;
}
}
# Try some common Linux hostname files first
my $fromfile;
if ($skipfile) {
@@ -4347,24 +4328,24 @@ if (!$system_hostname[$m]) {
if ($m) {
$fromfile =~ s/\..*$//;
}
$system_hostname[$m] = $fromfile;
$main::get_system_hostname[$m] = $fromfile;
return $fromfile;
}
# Can use hostname command on Unix
&execute_command("hostname", undef,
\$system_hostname[$m], undef, 0, 1);
chop($system_hostname[$m]);
\$main::get_system_hostname[$m], undef, 0, 1);
chop($main::get_system_hostname[$m]);
if ($?) {
eval "use Sys::Hostname";
if (!$@) {
$system_hostname[$m] = eval "hostname()";
$main::get_system_hostname[$m] = eval "hostname()";
}
if ($@ || !$system_hostname[$m]) {
$system_hostname[$m] = "UNKNOWN";
if ($@ || !$main::get_system_hostname[$m]) {
$main::get_system_hostname[$m] = "UNKNOWN";
}
}
elsif ($system_hostname[$m] !~ /\./ &&
elsif ($main::get_system_hostname[$m] !~ /\./ &&
$gconfig{'os_type'} =~ /linux$/ &&
!$gconfig{'no_hostname_f'} && !$_[0]) {
# Try with -f flag to get fully qualified name
@@ -4373,7 +4354,7 @@ if (!$system_hostname[$m]) {
undef, 0, 1);
chop($flag);
if (!$ex && $flag ne "") {
$system_hostname[$m] = $flag;
$main::get_system_hostname[$m] = $flag;
}
}
}
@@ -4385,14 +4366,14 @@ if (!$system_hostname[$m]) {
# Fall back to net name command
my $out = `net name 2>&1`;
if ($out =~ /\-+\r?\n(\S+)/) {
$system_hostname[$m] = $1;
$main::get_system_hostname[$m] = $1;
}
else {
$system_hostname[$m] = "windows";
$main::get_system_hostname[$m] = "windows";
}
}
}
return $system_hostname[$m];
return $main::get_system_hostname[$m];
}
=head2 get_webmin_version

View File

@@ -44,8 +44,8 @@ foreach my $repo ($webmin_apt_repo_file, $global_apt_repo_file) {
}
};
foreach my $l (@$lref) {
if ($l =~ /^\s*deb\s+.*?((http|https):\/\/download.webmin.com\/download\/repository)\s+sarge\s+contrib/) {
$l = &$lreffix("deb [signed-by=$webmin_apt_repo_key] $webmin_apt_repo_url stable contrib");
if ($l =~ /^\s*deb\s+.*?((http|https):\/\/download.webmin.com\/download\/(repository|newkey\/repository))\s+(sarge|stable)\s+contrib/) {
$l = &$lreffix("deb [signed-by=$webmin_apt_repo_key] $webmin_apt_repo_url webmin main");
$fixed++;
}
}

View File

@@ -1014,7 +1014,7 @@ notif_updateok=Install Updates Now
notif_reboot=Recent package updates (such as a new kernel version) require a reboot to be fully applied.
notif_rebootok=Reboot Now
notify_yumrepo=Your system is using the old Webmin repository. Click the button below to switch to the new repository URL <tt>$1</tt> in order to use our latest signing key and ensure access to updated Webmin versions.
notify_aptrepo=Your system is using the old Webmin repository. Click the button below to switch to the new <tt>stable</tt> repository URL <tt>$1</tt> in order to use our latest signing key and ensure access to updated Webmin versions.
notify_aptrepo_newkey=Your system is using obsolete Webmin repository. Please click the button below to switch to the new <tt>webmin main</tt> repository URL <tt>$1</tt> in order to use our latest signing key and ensure access to updated Webmin versions.
notif_fixreponow=Update Webmin Repository
status_title=Background Status Collection

View File

@@ -67,8 +67,10 @@ our $webmin_yum_repo_mirrorlist = $webmin_yum_repo_url."/mirrorlist";
our $webmin_yum_repo_key = "/etc/pki/rpm-gpg/RPM-GPG-KEY-webmin-developers";
our $webmin_apt_repo_file = "/etc/apt/sources.list.d/webmin.list";
our $webmin_apt_repo_url = "https://download.webmin.com/download/newkey/repository";
our $webmin_apt_repo_url = "https://download.webmin.com/download/repo";
our $webmin_apt_repo_key = "/usr/share/keyrings/debian-webmin-developers.gpg";
$webmin_apt_repo_key = "/usr/share/keyrings/ubuntu-webmin-developers.gpg"
if ($gconfig{'real_os_type'} =~ /ubuntu/i);
our $global_apt_repo_file = "/etc/apt/sources.list";
# Obsolete, but still defined so it can be deleted
@@ -1340,9 +1342,8 @@ foreach my $repo ($webmin_apt_repo_file, $global_apt_repo_file) {
next if (!-r $repo);
my $lref = &read_file_lines($repo, 1);
foreach my $l (@$lref) {
if ($l =~ /^\s*deb\s+.*?((http|https):\/\/download.webmin.com\/download\/repository)\s+sarge\s+contrib/) {
$repoerr = &text('notify_aptrepo',
$webmin_apt_repo_url);
if ($l =~ /^\s*deb\s+.*?((http|https):\/\/download.webmin.com\/download\/(repository|newkey\/repository))\s+(sarge|stable)\s+contrib/) {
$repoerr = &text('notify_aptrepo_newkey', $webmin_apt_repo_url);
last;
}
}