From d99a24b0456566ce2f1791cae68311ef0914384c Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Thu, 25 Sep 2025 14:48:14 +0300 Subject: [PATCH 01/14] Fix to remove significant bottleneck of shelling out --- miniserv.pl | 166 ++++++++++++++++------------------------------------ 1 file changed, 52 insertions(+), 114 deletions(-) diff --git a/miniserv.pl b/miniserv.pl index aa12670ed..3a3f69ac7 100755 --- a/miniserv.pl +++ b/miniserv.pl @@ -4784,7 +4784,7 @@ eval 'Net::SSLeay::CTX_set_options($ssl_ctx, &Net::SSLeay::OP_NO_RENEGOTIATION)'; # Get the hostnames each cert is valid for -my $info = &cert_file_info($certfile); +my $info = &cert_names($certfile); my @hosts; push(@hosts, $info->{'cn'}) if ($info->{'cn'}); push(@hosts, @{$info->{'alt'}}) if ($info->{'alt'}); @@ -5524,7 +5524,7 @@ foreach my $pe (split(/\t+/, $config{'expires_paths'})) { undef(%sudocache); # Reset cache of cert files -undef(%cert_file_info_cache); +undef(%cert_names_cache); } # is_group_member(&uinfo, groupname) @@ -7014,122 +7014,60 @@ if (!$sig) { return $sig; } -# cert_file_info(file) -# Returns a hash of details of a cert in some file -sub cert_file_info -{ -local ($file) = @_; -return $cert_file_info_cache{$file} if ($cert_file_info_cache{$file}); -return undef if (!-r $file); -my %rv; -my $cmd = "openssl x509 -in ".quotemeta($file)." -issuer -subject -enddate -startdate -text"; -open(OUT, $cmd." 2>/dev/null |"); -local $_; -while() { - s/\r|\n//g; - s/http:\/\//http:\|\|/g; # So we can parse with regexp - if (/subject=.*C\s*=\s*([^\/,]+)/) { - $rv{'c'} = $1; - } - if (/subject=.*ST\s*=\s*([^\/,]+)/) { - $rv{'st'} = $1; - } - if (/subject=.*L\s*=\s*([^\/,]+)/) { - $rv{'l'} = $1; - } - if (/subject=.*O\s*=\s*"(.*?)"/ || /subject=.*O\s*=\s*([^\/,]+)/) { - $rv{'o'} = $1; - } - if (/subject=.*OU\s*=\s*([^\/,]+)/) { - $rv{'ou'} = $1; - } - if (/subject=.*CN\s*=\s*([^\/,]+)/) { - $rv{'cn'} = $1; - } - if (/subject=.*emailAddress\s*=\s*([^\/,]+)/) { - $rv{'email'} = $1; - } +=head2 cert_names($file) - if (/issuer=.*C\s*=\s*([^\/,]+)/) { - $rv{'issuer_c'} = $1; - } - if (/issuer=.*ST\s*=\s*([^\/,]+)/) { - $rv{'issuer_st'} = $1; - } - if (/issuer=.*L\s*=\s*([^\/,]+)/) { - $rv{'issuer_l'} = $1; - } - if (/issuer=.*O\s*=\s*"(.*?)"/ || /issuer=.*O\s*=\s*([^\/,]+)/) { - $rv{'issuer_o'} = $1; - } - if (/issuer=.*OU\s*=\s*([^\/,]+)/) { - $rv{'issuer_ou'} = $1; - } - if (/issuer=.*CN\s*=\s*([^\/,]+)/) { - $rv{'issuer_cn'} = $1; - } - if (/issuer=.*emailAddress\s*=\s*([^\/,]+)/) { - $rv{'issuer_email'} = $1; - } - if (/notAfter\s*=\s*(.*)/) { - $rv{'notafter'} = $1; - } - if (/notBefore\s*=\s*(.*)/) { - $rv{'notbefore'} = $1; - } - if (/Subject\s+Alternative\s+Name/i) { - my $alts = ; - $alts =~ s/^\s+//; - foreach my $a (split(/[, ]+/, $alts)) { - if ($a =~ /^DNS:(\S+)/) { - push(@{$rv{'alt'}}, $1); - } - } - } - # Try to detect key algorithm - if (/Key\s+Algorithm:.*?(rsa|ec)[EP]/) { - $rv{'algo'} = $1; - } - if (/RSA\s+Public\s+Key:\s+\((\d+)\s*bit/) { - $rv{'size'} = $1; - } - elsif (/EC\s+Public\s+Key:\s+\((\d+)\s*bit/) { - $rv{'size'} = $1; - } - elsif (/Public-Key:\s+\((\d+)\s*bit/) { - $rv{'size'} = $1; - } - if (/Modulus\s*\(.*\):/ || /Modulus:/) { - $inmodulus = 1; - # RSA algo - $rv{'algo'} = "rsa" if (!$rv{'algo'}); - } - elsif (/pub:/) { - $inmodulus = 1; - # ECC algo - $rv{'algo'} = 'ec' if (!$rv{'algo'}); - } - if (/^\s+([0-9a-f:]+)\s*$/ && $inmodulus) { - $rv{'modulus'} .= $1; - } - # RSA exponent - if (/Exponent:\s*(\d+)/) { - $rv{'exponent'} = $1; - $inmodulus = 0; - } - # ECC properties - elsif (/(ASN1\s+OID):\s*(\S+)/ || /(NIST\s+CURVE):\s*(\S+)/) { - $inmodulus = 0; - my $comma = $rv{'exponent'} ? ", " : ""; - $rv{'exponent'} .= "$comma$1: $2"; +Extract Common Name and Subject Alternative Names from an X.509 certificate +file. Supports both PEM and DER certificates. Returns undef if file cannot be +read or parsed. Cache results for speed. + +=cut +sub cert_names +{ +my ($file) = @_; +return $cert_names_cache{$file} if ($cert_names_cache{$file}); +return undef if (!$file || !-r $file); +my %rv; +my $cert; + +# Try PEM first +my $bio = Net::SSLeay::BIO_new_file($file, 'r'); +if ($bio) { + $cert = Net::SSLeay::PEM_read_bio_X509($bio); + Net::SSLeay::BIO_free($bio); + } + +# Try DER if PEM failed +if (!$cert) { + my $bio = Net::SSLeay::BIO_new_file($file, 'rb'); + if ($bio) { + $cert = Net::SSLeay::d2i_X509_bio($bio); + Net::SSLeay::BIO_free($bio); } } -close(OUT); -foreach my $k (keys %rv) { - $rv{$k} =~ s/http:\|\|/http:\/\//g; + +# Certificate not found +return undef if !$cert; + +# Subject +my $subject = Net::SSLeay::X509_get_subject_name($cert); +if ($subject) { + # commonName + my $cn = Net::SSLeay::X509_NAME_get_text_by_NID($subject, 13); + $rv{cn} = $cn if defined $cn && $cn ne '' && $cn ne '-1'; } -$rv{'self'} = $rv{'o'} eq $rv{'issuer_o'} ? 1 : 0; -$cert_file_info_cache{$file} = \%rv; + +# subjectAltName +my @alts = Net::SSLeay::X509_get_subjectAltNames($cert); +if (@alts) { + my @dns; + while (my ($type, $val) = splice(@alts, 0, 2)) { + push @dns, $val if $type == 2; + } + $rv{alt} = \@dns if @dns; + } + +Net::SSLeay::X509_free($cert); +$cert_names_cache{$file} = \%rv; return \%rv; } From a027ad5dd6c4de3e35d9483fdc5e266355218fe8 Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Thu, 25 Sep 2025 15:23:06 +0300 Subject: [PATCH 02/14] Fix variable names to avoid ambiguity * Note: Discussed here: https://github.com/webmin/webmin/pull/2553#issuecomment-3328436525 --- forgot.cgi | 4 ++-- forgot_form.cgi | 4 ++-- forgot_send.cgi | 4 ++-- miniserv.pl | 10 +++++----- web-lib-funcs.pl | 6 +++--- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/forgot.cgi b/forgot.cgi index 98aefbacf..8726f5fd4 100755 --- a/forgot.cgi +++ b/forgot.cgi @@ -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 diff --git a/forgot_form.cgi b/forgot_form.cgi index 12015ae3c..608cc7a76 100755 --- a/forgot_form.cgi +++ b/forgot_form.cgi @@ -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); diff --git a/forgot_send.cgi b/forgot_send.cgi index 3db41c484..a42d705c6 100755 --- a/forgot_send.cgi +++ b/forgot_send.cgi @@ -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 diff --git a/miniserv.pl b/miniserv.pl index aa12670ed..d994ffd57 100755 --- a/miniserv.pl +++ b/miniserv.pl @@ -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 ". @@ -2503,9 +2503,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) { diff --git a/web-lib-funcs.pl b/web-lib-funcs.pl index bcc8853ca..d19292cef 100755 --- a/web-lib-funcs.pl +++ b/web-lib-funcs.pl @@ -13261,11 +13261,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; From 7a723719da538f19703a034711786004050c09ee Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Thu, 25 Sep 2025 15:33:52 +0300 Subject: [PATCH 03/14] Fix to recommend Sys::Syslog module #2557 --- makedebian.pl | 2 +- makerpm.pl | 2 +- setup.pl | 2 +- setup.sh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/makedebian.pl b/makedebian.pl index 6f91c48ad..d67081b95 100755 --- a/makedebian.pl +++ b/makedebian.pl @@ -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 < Date: Sat, 27 Sep 2025 02:08:45 +0300 Subject: [PATCH 04/14] Fix to add a flag to copy tar build too --- makemodulerpm.pl | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/makemodulerpm.pl b/makemodulerpm.pl index 3b3aebb38..9731326b7 100755 --- a/makemodulerpm.pl +++ b/makemodulerpm.pl @@ -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,14 @@ 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 =~ tr/0-9//dr; + $tar_release_file = "$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 +581,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]) From c86c45b10a1f68d3560ad639f428fb00baa535e8 Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Sat, 27 Sep 2025 03:00:44 +0300 Subject: [PATCH 05/14] Fix to keep release number too in tar builds --- makemodulerpm.pl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/makemodulerpm.pl b/makemodulerpm.pl index 9731326b7..f000cca1f 100755 --- a/makemodulerpm.pl +++ b/makemodulerpm.pl @@ -562,8 +562,7 @@ close($SPEC); # Put the tar in /tmp too if tar package is requested my $tar_release_file; if ($copy_tar) { - my $tar_release = $release =~ tr/0-9//dr; - $tar_release_file = "$mod-$ver$tar_release.tar.gz"; + $tar_release_file = "$mod-$ver-$release.tar.gz"; system("cp $rpm_source_dir/$mod.tar.gz /tmp/$tar_release_file"); } From 25fa7c589d95142c3d40699fd2ad993115002e82 Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Sat, 27 Sep 2025 03:50:54 +0300 Subject: [PATCH 06/14] Fix to add prefix for tar builds too --- makemodulerpm.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makemodulerpm.pl b/makemodulerpm.pl index f000cca1f..6103f73f4 100755 --- a/makemodulerpm.pl +++ b/makemodulerpm.pl @@ -562,7 +562,7 @@ close($SPEC); # Put the tar in /tmp too if tar package is requested my $tar_release_file; if ($copy_tar) { - $tar_release_file = "$mod-$ver-$release.tar.gz"; + $tar_release_file = "$prefix$mod-$ver-$release.tar.gz"; system("cp $rpm_source_dir/$mod.tar.gz /tmp/$tar_release_file"); } From be3fcb89b0b6fac29e2b850a7534d53c18e2f080 Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Sat, 27 Sep 2025 18:28:52 +0300 Subject: [PATCH 07/14] Fix to remove release number from tar builds as never applicable --- makemodulerpm.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makemodulerpm.pl b/makemodulerpm.pl index 6103f73f4..52bb20f4e 100755 --- a/makemodulerpm.pl +++ b/makemodulerpm.pl @@ -562,7 +562,7 @@ close($SPEC); # Put the tar in /tmp too if tar package is requested my $tar_release_file; if ($copy_tar) { - $tar_release_file = "$prefix$mod-$ver-$release.tar.gz"; + $tar_release_file = "$prefix$mod-$ver.tar.gz"; system("cp $rpm_source_dir/$mod.tar.gz /tmp/$tar_release_file"); } From 89d23c5aa87659c08d36ec8878f2aca1f6b5e4b1 Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Sat, 27 Sep 2025 20:06:57 +0300 Subject: [PATCH 08/14] 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 --- makemodulerpm.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/makemodulerpm.pl b/makemodulerpm.pl index 52bb20f4e..3cd6f57c3 100755 --- a/makemodulerpm.pl +++ b/makemodulerpm.pl @@ -562,7 +562,9 @@ close($SPEC); # Put the tar in /tmp too if tar package is requested my $tar_release_file; if ($copy_tar) { - $tar_release_file = "$prefix$mod-$ver.tar.gz"; + my $tar_release = $release; + $tar_release =~ s/^[0-9]+//; + $tar_release_file = "$mod-$ver$tar_release.tar.gz"; system("cp $rpm_source_dir/$mod.tar.gz /tmp/$tar_release_file"); } From 95423c74255326c892e1491ee2e0347ec86352b4 Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Sat, 27 Sep 2025 20:09:52 +0300 Subject: [PATCH 09/14] Fix not to loose prefix --- makemodulerpm.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makemodulerpm.pl b/makemodulerpm.pl index 3cd6f57c3..9d3b6fe01 100755 --- a/makemodulerpm.pl +++ b/makemodulerpm.pl @@ -564,7 +564,7 @@ my $tar_release_file; if ($copy_tar) { my $tar_release = $release; $tar_release =~ s/^[0-9]+//; - $tar_release_file = "$mod-$ver$tar_release.tar.gz"; + $tar_release_file = "$prefix$mod-$ver$tar_release.tar.gz"; system("cp $rpm_source_dir/$mod.tar.gz /tmp/$tar_release_file"); } From 1f4b467ea85548665b4ba31507996e377159d63d Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Sun, 28 Sep 2025 01:20:29 +0300 Subject: [PATCH 10/14] Fix to never mess around with headers; no headers check log --- web-lib-funcs.pl | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/web-lib-funcs.pl b/web-lib-funcs.pl index d19292cef..8646d9420 100755 --- a/web-lib-funcs.pl +++ b/web-lib-funcs.pl @@ -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 From f27b1415be2a00248a5ed16198f860a756454a69 Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Sun, 28 Sep 2025 01:27:54 +0300 Subject: [PATCH 11/14] Fix to remove extra space *Note: Made to trigger a re-built for testing purposes --- custom/custom-lib.pl | 1 - 1 file changed, 1 deletion(-) diff --git a/custom/custom-lib.pl b/custom/custom-lib.pl index 45e96a266..fbdbf13ee 100755 --- a/custom/custom-lib.pl +++ b/custom/custom-lib.pl @@ -647,5 +647,4 @@ else { } } - 1; From a0d99e0a31cb09ef5a3c3ad57b816dd7c0ab0c1e Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Sun, 28 Sep 2025 02:02:11 +0300 Subject: [PATCH 12/14] Dev: Trigger rebuilt for testing purposes --- custom/custom-lib.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom/custom-lib.pl b/custom/custom-lib.pl index fbdbf13ee..0a7b32659 100755 --- a/custom/custom-lib.pl +++ b/custom/custom-lib.pl @@ -647,4 +647,4 @@ else { } } -1; +1; From 956ad7ed0f6b17aee7e84999f36c595e0f4bb3b5 Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Sun, 28 Sep 2025 02:05:04 +0300 Subject: [PATCH 13/14] Dev: Trigger rebuilt for testing purposes for all modules [no-commit-check] --- custom/custom-lib.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom/custom-lib.pl b/custom/custom-lib.pl index 0a7b32659..fbdbf13ee 100755 --- a/custom/custom-lib.pl +++ b/custom/custom-lib.pl @@ -647,4 +647,4 @@ else { } } -1; +1; From 86968bfc31ba4dc474f1e26252d36e7f5a9490d6 Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Mon, 29 Sep 2025 18:23:10 +0300 Subject: [PATCH 14/14] Fix support for other Raspberry Pi sensors #2545 --- proc/linux-lib.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/proc/linux-lib.pl b/proc/linux-lib.pl index 35e17a93b..c982455a2 100755 --- a/proc/linux-lib.pl +++ b/proc/linux-lib.pl @@ -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);