Compare commits

...

30 Commits

Author SHA1 Message Date
Ilia Ross
d694649872 Fix to safely get user hostname from URL 2025-10-03 03:19:54 +03:00
Ilia Ross
991795c296 Fix to redirect to HTTPS when we get the host from the browser URL 2025-10-02 15:52:14 +03:00
Ilia Ross
8932f3bd6a Fix to truly move option tag rather than recreating
*Note: It keep existing styles and using index from "add()" will also put moved options to the top of the select and make them clearly visible
2025-10-02 13:36:22 +03:00
Ilia Ross
b3ec083c7b Update changelog 2025-10-01 23:45:22 +03:00
Ilia Ross
da18dea780 Update changelog release date to today (night) 2025-10-01 20:19:58 +03:00
Ilia Ross
35f8061049 Fix to kill Webmin subprocesses during RC stop on FreeBSD and other systems 2025-10-01 20:12:54 +03:00
Ilia Ross
e6e79a7eb5 Fix to replace vmstat with /proc sampler for same output with much lower overhead 2025-10-01 18:35:20 +03:00
Ilia Ross
a4d1280ef7 Fix copy-paste artifact 2025-10-01 14:34:40 +03:00
Ilia Ross
cc2cc62717 Fix to query specific fields in FreeBSD memory stats collection
*Note: Replace `sysctl -a` with targeted queries for only the 5 needed values (hw.physmem, hw.pagesize, vm.stats.vm.v_*_count) instead of dumping thousands of kernel params. This reduces `get_memory_info()` overhead from 25% CPU to ~5% CPU when called by real-time monitoring every 1-3 seconds.
2025-10-01 14:33:22 +03:00
Ilia Ross
c59591e3de Update changelog 2025-10-01 01:15:54 +03:00
Ilia Ross
fc4e2751dc Fix broken redirect when there is no way to get FQDN
*Note: "$host = &get_socket_name(SOCK, $ipv6fhs{$s});" won't return FQDN if it can't be resolved (or if it isn't in /etc/hosts), breaking some redirects, most likely proxied ones that aren't using HTTPS in its config.
2025-10-01 01:03:45 +03:00
Ilia Ross
4dc64f5028 Fix recommended package name (again) 2025-09-30 23:51:27 +03:00
Ilia Ross
01d2323496 Fix to mention IO::Socket::INET6 too 2025-09-30 22:28:08 +03:00
Ilia Ross
4c8b0fe008 Update changelog for 2.520 2025-09-30 17:26:46 +03:00
Jamie Cameron
e44ec464eb Merge branch 'master' of github.com:webmin/webmin 2025-09-29 13:35:49 -07:00
Jamie Cameron
98c54fe3fb Include config files by default
https://github.com/webmin/webmin/issues/2562
2025-09-29 13:35:43 -07:00
Ilia Ross
86968bfc31 Fix support for other Raspberry Pi sensors #2545 2025-09-29 18:23:10 +03:00
Ilia Ross
956ad7ed0f Dev: Trigger rebuilt for testing purposes for all modules
[no-commit-check]
2025-09-28 02:05:04 +03:00
Ilia Ross
a0d99e0a31 Dev: Trigger rebuilt for testing purposes 2025-09-28 02:02:11 +03:00
Ilia Ross
f27b1415be Fix to remove extra space
*Note: Made to trigger a re-built for testing purposes
2025-09-28 01:27:54 +03:00
Ilia Ross
1f4b467ea8 Fix to never mess around with headers; no headers check log 2025-09-28 01:20:29 +03:00
Ilia Ross
95423c7425 Fix not to loose prefix 2025-09-27 20:09:52 +03:00
Ilia Ross
89d23c5aa8 Fix for tar builds have no release but consider edition
*Note: Release for tar files should exist, however edition that can be passed like .gpl or .pro should exist
2025-09-27 20:06:57 +03:00
Ilia Ross
be3fcb89b0 Fix to remove release number from tar builds as never applicable 2025-09-27 18:28:52 +03:00
Ilia Ross
25fa7c589d Fix to add prefix for tar builds too 2025-09-27 03:50:54 +03:00
Ilia Ross
c86c45b10a Fix to keep release number too in tar builds 2025-09-27 03:00:44 +03:00
Ilia Ross
f10540bd54 Fix to add a flag to copy tar build too 2025-09-27 02:08:45 +03:00
Jamie Cameron
388f51843f Merge pull request #2558 from webmin/dev/remove-bottleneck-of-shelling-out
Fix to remove significant bottleneck of shelling out
2025-09-25 20:28:21 -07:00
Ilia Ross
7a723719da Fix to recommend Sys::Syslog module #2557 2025-09-25 15:33:52 +03:00
Ilia Ross
a027ad5dd6 Fix variable names to avoid ambiguity
* Note: Discussed here:
https://github.com/webmin/webmin/pull/2553#issuecomment-3328436525
2025-09-25 15:23:06 +03:00
17 changed files with 190 additions and 81 deletions

View File

@@ -1,7 +1,22 @@
## Changelog
#### 2.511 (September, 2025)
#### 2.520 (October 2, 2025)
* Fix to make sure the mail URL uses a well-known host name [security]
* Fix support for other Raspberry Pi sensors #2545
* Fix the printing of the bottom button row in the form column table
* Fix to recommend Perl `Sys::Syslog` module #2557
* Fix to avoid using short hostname in HTTPS redirects when an FQDN is available
* Fix to use _/proc_ sampler instead of `vmstat` for the same output with much lower overhead
* Fix to query specific fields in FreeBSD memory stats collection, cutting CPU use by 80%
* Fix to kill Webmin subprocesses during RC stop on FreeBSD and other systems
* Add a complete overhaul of `var_dump` subroutine, which is now fully portable
* Update the Authentic theme to the latest version with various fixes:
- Fix the text color when reading email in the Read User Mail module [webmin#2555](https://github.com/webmin/webmin/issues/2555)
- Fix to ensure the selected color palette is correctly stored when changed manually [webmin#2552](https://github.com/webmin/webmin/issues/2552)
- Fix a bug when the Webmin version label was missing when copying to clipboard system information from the dashboard
- Fix DNS query spike from network stats collection on FreeBSD [webmin#2556](https://github.com/webmin/webmin/issues/2556)
- Fix spinner color in toast messages for dark palette
- Fix other bugs and add various small improvements
#### 2.510 (September 16, 2025)
* Fix to ensure DNSSEC re-signing period is less than 30 days in the BIND DNS module

View File

@@ -15,6 +15,8 @@ if ($in{'new'}) {
$backup = { 'emode' => 0,
'email' => $gconfig{'webmin_email_to'},
'sched' => 1,
'configfile' => 1,
'nofiles' => 0,
'mins' => 0,
'hours' => 0,
'days' => '*',

View File

@@ -647,5 +647,4 @@ else {
}
}
1;

View File

@@ -16,9 +16,9 @@ my $timeout = $gconfig{'passreset_timeout'} || 15;
$remote_user && &error($text{'forgot_elogin'});
$ENV{'HTTPS'} eq 'ON' || $gconfig{'forgot_pass'} == 2 ||
&error($text{'forgot_essl'});
$ENV{'SSL_HOST_CERT'} == 1 ||
$ENV{'SSL_CN_CERT'} == 1 ||
&error(&text('forgot_esslhost',
&html_escape($ENV{'HTTP_HOST'} || $ENV{'SSL_HOST'})))
&html_escape($ENV{'HTTP_HOST'} || $ENV{'SSL_CN'})))
if ($ENV{'HTTPS'} eq 'ON');
# Check that the random ID is valid

View File

@@ -15,9 +15,9 @@ $gconfig{'forgot_pass'} || &error($text{'forgot_ecannot'});
$remote_user && &error($text{'forgot_elogin'});
$ENV{'HTTPS'} eq 'ON' || $gconfig{'forgot_pass'} == 2 ||
&error($text{'forgot_essl'});
$ENV{'SSL_HOST_CERT'} == 1 ||
$ENV{'SSL_CN_CERT'} == 1 ||
&error(&text('forgot_esslhost',
&html_escape($ENV{'HTTP_HOST'} || $ENV{'SSL_HOST'})))
&html_escape($ENV{'HTTP_HOST'} || $ENV{'SSL_CN'})))
if ($ENV{'HTTPS'} eq 'ON');
&ui_print_header(undef, $text{'forgot_title'}, "", undef, undef, 1, 1);

View File

@@ -14,9 +14,9 @@ $gconfig{'forgot_pass'} || &error($text{'forgot_ecannot'});
$remote_user && &error($text{'forgot_elogin'});
$ENV{'HTTPS'} eq 'ON' || $gconfig{'forgot_pass'} == 2 ||
&error($text{'forgot_essl'});
$ENV{'SSL_HOST_CERT'} == 1 ||
$ENV{'SSL_CN_CERT'} == 1 ||
&error(&text('forgot_esslhost',
&html_escape($ENV{'HTTP_HOST'} || $ENV{'SSL_HOST'})))
&html_escape($ENV{'HTTP_HOST'} || $ENV{'SSL_CN'})))
if ($ENV{'HTTPS'} eq 'ON');
# Lookup the Webmin user

View File

@@ -109,7 +109,7 @@ if ($product eq "webmin") {
$size = int(`du -sk $tmp_dir`);
@deps = ( "perl", "libnet-ssleay-perl", "openssl", "libauthen-pam-perl", "libpam-runtime", "libio-pty-perl", "unzip", "shared-mime-info", "tar", "libdigest-sha-perl", "libdigest-md5-perl", "gzip" );
$deps = join(", ", @deps);
@recommends = ( "libdatetime-perl", "libdatetime-timezone-perl", "libdatetime-locale-perl", "libtime-piece-perl", "libencode-detect-perl", "libtime-hires-perl", "libsocket6-perl", "html2text", "qrencode", "libdbi-perl", "libdbd-mysql-perl", "libjson-xs-perl" );
@recommends = ( "libdatetime-perl", "libdatetime-timezone-perl", "libdatetime-locale-perl", "libtime-piece-perl", "libencode-detect-perl", "libtime-hires-perl", "libsocket6-perl", "html2text", "qrencode", "libdbi-perl", "libdbd-mysql-perl", "libjson-xs-perl", "libsys-syslog-perl" );
$recommends = join(", ", @recommends);
open(CONTROL, ">$control_file");
print CONTROL <<EOF;

View File

@@ -34,7 +34,7 @@ my $allow_overwrite = 0;
my ($force_theme, $no_prefix, $set_prefix,
$obsolete_wbm, $vendor, $url, $force_usermin, $final_mod, $sign, $keyname,
$epoch, $dir, $ver, @exclude,
$epoch, $dir, $ver, @exclude, $copy_tar,
$rpmdepends, $norpmdepends, $rpmrecommends, $norpmrecommends,
$no_requires, $no_recommends, $no_suggests, $no_conflicts, $no_provides,
@@ -136,6 +136,9 @@ while(@ARGV) {
elsif ($a eq "--mod-list") {
$mod_list = shift(@ARGV);
}
elsif ($a eq "--copy-tar") {
$copy_tar = 1;
}
elsif ($a =~ /^\-\-/) {
print STDERR "Unknown option $a\n";
exit(1);
@@ -556,6 +559,15 @@ fi
EOF
close($SPEC);
# Put the tar in /tmp too if tar package is requested
my $tar_release_file;
if ($copy_tar) {
my $tar_release = $release;
$tar_release =~ s/^[0-9]+//;
$tar_release_file = "$prefix$mod-$ver$tar_release.tar.gz";
system("cp $rpm_source_dir/$mod.tar.gz /tmp/$tar_release_file");
}
# Build the actual RPM
my $cmd = -x "/usr/bin/rpmbuild" ? "/usr/bin/rpmbuild" : "/bin/rpm";
system("$cmd -ba $spec_dir/$prefix$mod.spec") && exit;
@@ -570,10 +582,20 @@ if ($sign) {
if ($target_dir =~ /:/) {
# scp to dest
system("scp $rpm_dir/$prefix$mod-$ver-$release.noarch.rpm $target_dir/$prefix$mod-$ver-$release.noarch.rpm");
# scp the tar too if requested
if ($copy_tar) {
system("scp /tmp/$tar_release_file $target_dir/$tar_release_file");
unlink("/tmp/$tar_release_file");
}
}
elsif ($rpm_dir ne $target_dir) {
# Just copy
system("/bin/cp $rpm_dir/$prefix$mod-$ver-$release.noarch.rpm $target_dir/$prefix$mod-$ver-$release.noarch.rpm");
# Copy the tar too if requested
if ($copy_tar) {
system("/bin/cp /tmp/$tar_release_file $target_dir/$tar_release_file");
unlink("/tmp/$tar_release_file");
}
}
# read_file(file, &assoc, [&order], [lowercase])

View File

@@ -88,7 +88,7 @@ Release: $rel
Provides: %{name}-%{version} perl(WebminCore)
Requires(pre): /usr/bin/perl
Requires: /bin/sh /usr/bin/perl perl(lib) perl(open) perl(Net::SSLeay) perl(Time::Local) perl(Data::Dumper) perl(File::Path) perl(File::Basename) perl(Digest::SHA) perl(Digest::MD5) openssl unzip tar gzip
Recommends: perl(DateTime) perl(DateTime::TimeZone) perl(DateTime::Locale) perl(Time::Piece) perl(Encode::Detect) perl(Time::HiRes) perl(Socket6) html2text shared-mime-info perl-File-Basename perl-File-Path perl-JSON-XS qrencode perl(DBI) perl(DBD::mysql)
Recommends: perl(DateTime) perl(DateTime::TimeZone) perl(DateTime::Locale) perl(Time::Piece) perl(Encode::Detect) perl(Time::HiRes) perl(Socket6) perl(Sys::Syslog) html2text shared-mime-info perl-File-Basename perl-File-Path perl-JSON-XS qrencode perl(DBI) perl(DBD::mysql)
AutoReq: 0
License: BSD-3-Clause
Group: System/Tools

View File

@@ -942,8 +942,8 @@ while(1) {
($ssl_con,
$ssl_certfile,
$ssl_keyfile,
$ssl_host,
$ssl_cert_hosts) =
$ssl_cn,
$ssl_alts) =
&ssl_connection_for_ip(
SOCK, $ipv6fhs{$s});
print DEBUG "ssl_con returned ".
@@ -1381,26 +1381,48 @@ $method = $page = $request_uri = undef;
print DEBUG "handle_request reqline=$reqline\n";
alarm(0);
if (!$use_ssl && $config{'ssl'} && $config{'ssl_enforce'}) {
# This is an http request when https must be enforced
local $urlhost = $config{'musthost'} || $host;
$urlhost = "[".$urlhost."]" if (&check_ip6address($urlhost));
local $wantport = $port;
if ($wantport == 80 &&
&indexof(443, @listening_on_ports) >= 0) {
# Connection was to port 80, but since we are also
# accepting on port 443, redirect to that
$wantport = 443;
# This is an HTTP request when HTTPS should be enforced
my $musthost = $config{'musthost'};
my $hostheader;
if (!$musthost) {
# Read host HTTP header because we want one earlier
alarm(10);
local $SIG{'ALRM'} = sub { die "timeout" };
while (defined(my $line = &read_line())) {
$line =~ s/\r|\n//g;
last if $line eq '';
if ($line =~ /^host:\s*(.*)$/i) {
$hostheader = "https://$1";
last;
}
}
alarm(0);
}
local $url = $wantport == 443
? "https://$urlhost/"
: "https://$urlhost:$wantport/";
# Host header must already contain full URL
my $url = $hostheader;
if (!$url) {
# No host header
local $urlhost = $musthost || $host;
$urlhost = "[".$urlhost."]" if (&check_ip6address($urlhost));
local $wantport = $port;
if ($wantport == 80 &&
&indexof(443, @listening_on_ports) >= 0) {
# Connection was to port 80, but since we are also
# accepting on port 443, redirect to that
$wantport = 443;
}
$url = $wantport == 443
? "https://$urlhost/"
: "https://$urlhost:$wantport/";
}
# Enforce HTTPS
&write_data("HTTP/1.0 302 Moved Temporarily\r\n");
&write_data("Date: $datestr\r\n");
&write_data("Server: @{[&server_info()]}\r\n");
&write_data("Location: $url\r\n");
&write_keep_alive(0);
&write_data("\r\n");
&log_error("Redirecting HTTP request to HTTPS for $acptip");
&log_error("Redirecting HTTP request to $url");
&log_request($loghost, $authuser, $reqline, 302, 0);
return 0;
}
@@ -2503,9 +2525,9 @@ if (&get_type($full) eq "internal/cgi" && $validated != 4) {
$ENV{"HTTPS"} = $use_ssl ? "ON" : "";
$ENV{"SSL_HSTS"} = $config{"ssl_hsts"};
if ($use_ssl) {
$ENV{"SSL_HOST"} = $ssl_host;
$ENV{"SSL_HOST_CERT"} =
&ssl_hostname_match($header{'host'}, $ssl_cert_hosts);
$ENV{"SSL_CN"} = $ssl_cn;
$ENV{"SSL_CN_CERT"} =
&ssl_hostname_match($header{'host'}, $ssl_alts);
}
$ENV{"MINISERV_PID"} = $miniserv_main_pid;
if ($use_ssl) {

View File

@@ -101,7 +101,16 @@ ioctl($ttyfh, 536900705, 0);
sub get_memory_info
{
my $sysctl = {};
my $sysctl_output = &backquote_command("/sbin/sysctl -a 2>/dev/null");
# Get only the specific values we need not all with -a
my @needed = qw(
hw.physmem
hw.pagesize
vm.stats.vm.v_inactive_count
vm.stats.vm.v_cache_count
vm.stats.vm.v_free_count
);
my $sysctl_output = &backquote_command("/sbin/sysctl " .
join(" ", @needed) . " 2>/dev/null");
return ( ) if ($?);
foreach my $line (split(/\n/, $sysctl_output)) {
if ($line =~ m/^([^:]+):\s+(.+)\s*$/s) {

View File

@@ -700,14 +700,14 @@ if (!@fans && @cpu && @fans_all &&
}
# Fall back logic for CPU temperature and fans spread over multiple
# devices like Raspberry Pi #2517 and #2539
# devices like Raspberry Pi #2517 and #2539 #2545
if (@cpu || !@fans) {
# - Look for least two ISA voltage rails anywhere
# - See a CPU temp under cpu_thermal
# - Optionally grab a fan RPM under pwmfan-isa-*
# - Optionally grab a fan RPM under *fan-isa-*
my $can_fallback =
(!@cpu && (grep { /^\s*cpu_thermal/i } @sensors)) ||
(@cpu && !@fans && (grep { /^\s*pwmfan-isa-/i } @sensors));
(@cpu && !@fans && (grep { /fan-isa-\d+/i } @sensors));
return (\@cpu, \@fans) if (!$can_fallback);
my ($chip, $bus); # isa|pci|platform|virtual
my $isa_volt;
@@ -735,7 +735,7 @@ if (@cpu || !@fans) {
}
# Fan RPM
if (defined $chip && $chip =~ /^pwmfan/i &&
if (defined $chip && $chip =~ /fan$/i &&
/\b(?:cpu[_ ]?fan(?:\s*\d+)?|fan\d+)\s*:\s*(\d+)\s*rpm\b/i) {
my $rpm = $1 + 0;
$fan_rpm = $rpm if (!$fan_rpm || $rpm > $fan_rpm);
@@ -754,31 +754,65 @@ return (\@cpu, \@fans);
}
# get_cpu_io_usage()
# Returns a list containing CPU user, kernel, idle, io and VM time, and IO
# blocks in and out
# Returns a list of "us", "sy", "id", "wa", "st", "bi", "bo" that match `vmstat`
# output by using /proc with much lower overhead
sub get_cpu_io_usage
{
my ($nodelay) = @_;
my $interval;
$interval = " 1 2"
if (!$nodelay);
my ($out, @lines, @w);
if (&has_command("vmstat")) {
$out = &backquote_command("vmstat$interval 2>/dev/null");
@lines = split(/\r?\n/, $out);
@w = split(/\s+/, $lines[$#lines]);
shift(@w) if ($w[0] eq '');
if ($w[8] =~ /^\d+$/ && $w[9] =~ /^\d+$/) {
return ( @w[12..16], $w[8], $w[9] );
}
} elsif (&has_command("dstat")) {
$out = &backquote_command("dstat 1 1 2>/dev/null");
@lines = split(/\r?\n/, $out);
@w = split(/[\s|]+/, $lines[$#lines]);
shift(@w) if ($w[0] eq '');
return( @w[0..4], @w[6..7]);
}
return undef;
# Read CPU counters from /proc/stat, the first "cpu" line
my $read_cpu = sub {
open(my $fh, '<', '/proc/stat') or return;
my $line = <$fh>;
close($fh);
return unless defined $line && $line =~ /^cpu\s+/;
my @v = split /\s+/, $line; shift @v;
push @v, (0) x (8-@v) if @v < 8;
return @v[0..7];
};
# Read pgpgin/pgpgout from /proc/vmstat (in KB). Note, that all modern kernels,
# /proc/vmstat pgpgin/pgpgout are KiB (scale=1); not as *pages*, so no need to
# convert deltas
my $read_io = sub {
open(my $fh, '<', '/proc/vmstat') or return (undef, undef);
my ($in, $out);
while (my $l = <$fh>) {
$in = $1 if !defined $in && $l =~ /^pgpgin\s+(\d+)/;
$out = $1 if !defined $out && $l =~ /^pgpgout\s+(\d+)/;
last if defined $in && defined $out;
}
close($fh);
return ($in, $out); # KB on kernels 2.6.18+; no conversion needed
};
# Sample A
my @cb = $read_cpu->() or return;
my ($pgin_b, $pgout_b) = $read_io->();
# Sleep half a second
select(undef, undef, undef, 0.5);
# Sample B
my @ca = $read_cpu->() or return;
my ($pgin_a, $pgout_a) = $read_io->();
# CPU percentages as in vmstat
my @d = map { $ca[$_] - $cb[$_] } 0..7;
for (@d) { $_ = 0 if $_ < 0 }
my $tot = 0; $tot += $_ for @d[0..7];
return if !$tot;
# Calculate percentages
my $us = int( (($d[0] + $d[1]) / $tot) * 100 ); # user+nice
my $sy = int( (($d[2] + $d[5] + $d[6]) / $tot) * 100 ); # system+irq+softirq
my $id = int( ( $d[3] / $tot ) * 100 ); # idle
my $wa = int( ( $d[4] / $tot ) * 100 ); # iowait
my $st = int( ( $d[7] / $tot ) * 100 ); # steal
# Calculate bi/bo in KiB/s over half a second
my ($bi, $bo) = (0, 0);
$bi = int( (($pgin_a // 0) - ($pgin_b // 0)) / 0.5 );
$bo = int( (($pgout_a // 0) - ($pgout_b // 0)) / 0.5 );
return ($us, $sy, $id, $wa, $st, $bi, $bo);
}
# has_disk_stats()

View File

@@ -108,7 +108,7 @@ if ($out =~ /Primary\s+memory\s+available:\s+([0-9\.]+)\s+g/i) {
$rv[0] = $1 * 1024 * 1024;
}
else {
my $out = &backquote_command("sysctl -a hw.physmem 2>/dev/null");
my $out = &backquote_command("sysctl hw.physmem 2>/dev/null");
if ($out =~ /:\s*(\d+)/) {
$rv[0] = $1 / 1024;
}
@@ -129,7 +129,7 @@ if ($usage > $rv[0]) {
$rv[1] = $rv[0] - $usage;
# Get swap usage
$out = &backquote_command("sysctl -a vm.swapusage 2>/dev/null");
$out = &backquote_command("sysctl vm.swapusage 2>/dev/null");
if ($out =~ /total\s*=\s*([0-9\.]+)([KMGT]).*free\s*=\s*([0-9\.]+)([KMGT])/) {
$rv[2] = $1*($2 eq "K" ? 1 :
$2 eq "M" ? 1024 :
@@ -155,7 +155,7 @@ my $out = &backquote_command("uptime 2>&1");
my @rv = $out =~ /average(s)?:\s+([0-9\.]+),?\s+([0-9\.]+),?\s+([0-9\.]+)/i ?
( $2, $3, $4 ) : ( undef, undef, undef );
$out = &backquote_command("sysctl -a machdep.cpu.brand_string");
$out = &backquote_command("sysctl machdep.cpu.brand_string");
if ($out =~ /:\s*(\S.*)/) {
$rv[4] = $1;
if ($rv[4] =~ s/\s*\@\s*([0-9\.]+)(GHz|MHz)//i) {
@@ -169,7 +169,7 @@ if (!$?) {
$rv[5] = $out;
}
else {
$out = &backquote_command("sysctl -a machdep.cpu.vendor");
$out = &backquote_command("sysctl machdep.cpu.vendor");
if ($out =~ /:\s*(\S.*)/) {
$rv[5] = $1;
}
@@ -180,7 +180,7 @@ if ($out =~ /:\s*(\d+)/) {
$rv[6] = $1 * 1024;
}
$out = &backquote_command("sysctl -a machdep.cpu.core_count");
$out = &backquote_command("sysctl machdep.cpu.core_count");
if ($out =~ /:\s*(\d+)/) {
$rv[7] = $1;
}

View File

@@ -616,6 +616,13 @@ else {
print STOP "else\n";
print STOP " echo Stopping Webmin server in $wadir\n";
print STOP "fi\n";
print STOP "pids=\`ps axww -o pid= -o command= | awk -v wd=\"$wadir/\" '\$0 ~ wd && \$0 !~ /miniserv\\.pl/ {print \$1}'\`\n";
print STOP "[ -n \"\$pids\" ] && kill \$pids 2>/dev/null || true\n";
print STOP "if [ \"\$1\" = \"--kill\" ]; then\n";
print STOP " sleep 1\n";
print STOP " pids=\`ps axww -o pid= -o command= | awk -v wd=\"$wadir/\" '\$0 ~ wd && \$0 !~ /miniserv\\.pl/ {print \$1}'\`\n";
print STOP " [ -n \"\$pids\" ] && kill -KILL \$pids 2>/dev/null || true\n";
print STOP "fi\n";
print STOP "pidfile=\`grep \"^pidfile=\" $config_directory/miniserv.conf | sed -e 's/pidfile=//g'\`\n";
print STOP "pid=\`cat \$pidfile 2>/dev/null\`\n";
print STOP "if [ \"\$pid\" != \"\" ]; then\n";
@@ -971,7 +978,7 @@ if (!$ENV{'nostart'}) {
print " - DateTime, DateTime::Locale, DateTime::TimeZone, Data::Dumper,\n";
print " - Digest::MD5, Digest::SHA, Encode::Detect, File::Basename,\n";
print " - File::Path, Net::SSLeay, Time::HiRes, Time::Local, Time::Piece,\n";
print " - JSON::XS, lib, open\n";
print " - Socket6, Sys::Syslog, JSON::XS, lib, open\n";
print " Packages:\n";
print " - openssl - Cryptography library with TLS implementation\n";
print " - shared-mime-info - Shared MIME information database\n";

View File

@@ -695,6 +695,13 @@ echo " echo Force stopping Webmin server in $wadir" >>$config_dir/.stop-init
echo "else" >>$config_dir/.stop-init
echo " echo Stopping Webmin server in $wadir" >>$config_dir/.stop-init
echo "fi" >>$config_dir/.stop-init
echo "pids=\`ps axww -o pid= -o command= | awk -v wd=\"$wadir/\" '\$0 ~ wd && \$0 !~ /miniserv\\.pl/ {print \$1}'\`" >>$config_dir/.stop-init
echo "[ -n \"\$pids\" ] && kill \$pids 2>/dev/null || true" >>$config_dir/.stop-init
echo "if [ \"\$1\" = \"--kill\" ]; then" >>$config_dir/.stop-init
echo " sleep 1" >>$config_dir/.stop-init
echo " pids=\`ps axww -o pid= -o command= | awk -v wd=\"$wadir/\" '\$0 ~ wd && \$0 !~ /miniserv\\.pl/ {print \$1}'\`" >>$config_dir/.stop-init
echo " [ -n \"\$pids\" ] && kill -KILL \$pids 2>/dev/null || true" >>$config_dir/.stop-init
echo "fi" >>$config_dir/.stop-init
echo "pidfile=\`grep \"^pidfile=\" $config_dir/miniserv.conf | sed -e 's/pidfile=//g'\`" >>$config_dir/.stop-init
echo "pid=\`cat \$pidfile 2>/dev/null\`" >>$config_dir/.stop-init
echo "if [ \"\$pid\" != \"\" ]; then" >>$config_dir/.stop-init
@@ -1063,7 +1070,7 @@ if [ "$nostart" = "" ]; then
echo " - DateTime, DateTime::Locale, DateTime::TimeZone, Data::Dumper,"
echo " - Digest::MD5, Digest::SHA, Encode::Detect, File::Basename,"
echo " - File::Path, Net::SSLeay, Time::HiRes, Time::Local, Time::Piece,"
echo " - JSON::XS, lib, open"
echo " - Socket6, Sys::Syslog, JSON::XS, lib, open"
echo " Packages:"
echo " - openssl - Cryptography library with TLS implementation"
echo " - shared-mime-info - Shared MIME information database"

View File

@@ -1108,9 +1108,8 @@ if (dir == 1 && opts_idx >= 0) {
for(var i=0; i<opts.options.length; i++) {
var o = opts.options[i];
if (o.selected) {
vals.options[vals.options.length] =
new Option(o.text, o.value);
opts.remove(i);
o.selected = false;
vals.add(o, 0);
i--;
}
}
@@ -1120,9 +1119,8 @@ else if (dir == 0 && vals_idx >= 0) {
for(var i=0; i<vals.options.length; i++) {
var o = vals.options[i];
if (o.selected) {
opts.options[opts.options.length] =
new Option(o.text, o.value);
vals.remove(i);
o.selected = false;
opts.add(o, 0);
i--;
}
}

View File

@@ -7581,14 +7581,8 @@ if ($opened) {
close $fh or return "Error: close($file): $!";
}
# Optionally print to UI (web scripts only)
if ($main::webmin_script_type eq 'web') {
# Print HTTP header once per process
our $var_dump__hdr_sent ||= 0;
if (!$var_dump__hdr_sent && !$main::done_webmin_header) {
print "Content-type: text/html; charset=UTF-8\n\n";
$var_dump__hdr_sent = 1;
}
# Optionally print to UI (web scripts only) only if header already sent
if ($main::done_webmin_header && $main::webmin_script_type eq 'web') {
# Limit long dumps by wrapping parameter chunks between accordion lines
my $out = $dump_txt;
# Add header
@@ -13261,11 +13255,11 @@ if (!$def && $gconfig{'webmin_email_url'}) {
# From a config option
$url = $gconfig{'webmin_email_url'};
}
elsif ($ENV{'HTTP_HOST'} || $ENV{'SSL_HOST'}) {
elsif ($ENV{'HTTP_HOST'} || $ENV{'SSL_CN'}) {
# From this HTTP request
my $port = $ENV{'SERVER_PORT'} || 80;
my $host = $ENV{'SSL_HOST'}
? "$ENV{'SSL_HOST'}:$port"
my $host = $ENV{'SSL_CN'}
? "$ENV{'SSL_CN'}:$port"
: $ENV{'HTTP_HOST'};
if ($host =~ s/:(\d+)$//) {
$port = $1;