Merge branch 'master' of github.com:webmin/webmin

This commit is contained in:
Jamie Cameron 2025-06-12 09:57:24 -07:00
commit faa5dddb0a
12 changed files with 68 additions and 50 deletions

View File

@ -1,5 +1,8 @@
## Changelog
#### 2.402 (June 9, 2025)
* Update the Authentic theme to the latest version with various fixes and improvements
#### 2.401 (June 2, 2025)
* Add forgotten password recovery support for Virtualmin mailbox users
* Add forgotten password recovery support in Usermin

View File

@ -64,7 +64,7 @@ sub run
};
root($o->{'config'}, \&$conf_check);
my $service = ($o->{'config'} =~ /usermin/ ? 'usermin' : 'webmin');
my $systemctlcmd = `which systemctl`;
my $systemctlcmd = &has_command('systemctl');
$systemctlcmd =~ s/\s+$//;
if ($o->{'cmd'} =~ /^(start|stop|restart|reload)$/) {
my $rs = system("$o->{'config'}/$o->{'cmd'} $service");

View File

@ -1,34 +1,28 @@
#!/usr/local/bin/perl
# Builds a tar.gz package of a specified Webmin version
if ($0 =~ /^(.*)\//) {
chdir($1);
}
@ARGV == 1 || @ARGV == 2 || @ARGV == 3 || usage();
if ($ARGV[0] eq "-minimal" || $ARGV[0] eq "--minimal") {
$min++;
shift(@ARGV);
}
if ($ARGV[0] =~ /^--exclude-modules/) {
$exclude_modules = $ARGV[0];
shift(@ARGV);
}
if ($ARGV[0] =~ /^--product-type/) {
$product_type = $ARGV[0];
$product_type =~ s/--product-type=//;
if ($product_type =~ /^(minimal|essential)$/) {
$product_suff = "-$product_type";
$product_pref = "$product_type-";
# Parse command line options
$mod_list = 'full';
@ARGV = map { /^--\S+\s+/ ? split(/\s+/, $_) : $_ } @ARGV;
while (@ARGV && $ARGV[0] =~ /^--?/) {
my $opt = shift(@ARGV);
if ($opt eq '--minimal' || $opt eq '-minimal') {
$min = 1;
next;
}
shift(@ARGV);
if ($opt eq '--mod-list') {
$mod_list = shift(@ARGV) // usage();
next;
}
usage();
}
@ARGV == 1 || usage();
$fullvers = $ARGV[0];
$fullvers =~ /^([0-9\.]+)(\-(\d+))?$/ || usage();
$vers = $1;
$release = $3;
$tardir = $min ? "minimal" : "tarballs";
$vfile = $product_pref ? "$product_pref$fullvers" : $min ? "$fullvers-minimal" : $fullvers;
$zipdir = "zips";
$fullvers =~ /^([0-9\.]+)(?:-(\d+))?$/ || usage();
($vers, $release) = ($1, $2);
$tardir = $min ? 'minimal' : 'tarballs';
$vfile = $min ? "$fullvers-minimal" : $fullvers;
$zipdir = 'zips';
$vers || usage();
@files = ("config.cgi", "config-*-linux",
@ -70,20 +64,15 @@ if ($min) {
}
else {
# All the modules
my $mod_def_list;
my $mods_list;
my $curr_dir = $0;
($curr_dir) = $curr_dir =~ /^(.+)\/[^\/]+$/;
$curr_dir = "." if ($curr_dir !~ /^\//);
open(my $fh, '<', "$curr_dir/mod_def_list.txt") || die "Error opening \"mod_def_list.txt\" : $!\n";
$mod_def_list = do { local $/; <$fh> };
open(my $fh, '<', "$curr_dir/mod_${mod_list}_list.txt") ||
die "Error opening \"mod_${mod_list}_list.txt\" : $!\n";
$mods_list = do { local $/; <$fh> };
close($fh);
@mlist = split(/\s+/, $mod_def_list);
if ($exclude_modules) {
$exclude_modules =~ s/--exclude-modules=//;
my @mlist_excluded =
grep { my $f = $_; ! grep $_ eq $f, split(',', $exclude_modules) } @mlist;
@mlist = @mlist_excluded;
}
@mlist = split(/\s+/, $mods_list);
}
# Build EOL data
@ -296,6 +285,6 @@ close(ARFILE);
sub usage
{
die "usage: makedist.pl [-minimal] [--exclude-modules] <version>";
die "Usage: $0 [--minimal] [--mod-list type] <version>\n";
}

View File

@ -29,6 +29,8 @@ my ($force_theme, $url, $upstream, $debdepends, $debrecommends,
$no_prefix, $force_usermin, $release, $allow_overwrite, $final_mod,
$dsc_file, $dir, $ver, @exclude);
my $mod_list = 'full';
while(@ARGV) {
my $a = shift(@ARGV);
if ($a eq "--deb-depends") {
@ -79,6 +81,9 @@ while(@ARGV) {
elsif ($a eq "--exclude") {
push(@exclude, shift(@ARGV));
}
elsif ($a eq "--mod-list") {
$mod_list = shift(@ARGV);
}
elsif ($a =~ /^\-\-/) {
print STDERR "Unknown option $a\n";
exit(1);
@ -113,6 +118,7 @@ if (!$dir) {
print " [--dsc-file file.dsc]\n";
print " [--force-theme]\n";
print " [--exclude file-or-dir]\n";
print " [--mod-list full|core|minimal]\n";
print RESET, "\n";
exit(1);
}
@ -246,7 +252,7 @@ if ($debdepends && exists($minfo{'depends'})) {
my $curr_dir = $0;
($curr_dir) = $curr_dir =~ /^(.+)\/[^\/]+$/;
$curr_dir = "." if ($curr_dir !~ /^\//);
my $mod_def_file = "$curr_dir/mod_def_list.txt";
my $mod_def_file = "$curr_dir/mod_${mod_list}_list.txt";
next if (! -r $mod_def_file);
open(my $fh, '<', $mod_def_file) ||
die "Error opening \"$mod_def_file\" : $!\n";

View File

@ -32,10 +32,12 @@ my $release = 1;
$ENV{'PATH'} = "/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin";
my $allow_overwrite = 0;
my ($force_theme, $rpmdepends, $rpmrecommends, $no_prefix, $set_prefix, $vendor,
$url, $force_usermin, $final_mod, $sign, $keyname,
my ($force_theme, $rpmdepends, $rpmrecommends, $no_prefix, $set_prefix,
$obsolete_wbm, $vendor, $url, $force_usermin, $final_mod, $sign, $keyname,
$epoch, $dir, $ver, @exclude);
my $mod_list = 'full';
# Parse command-line args
while(@ARGV) {
# XXX Untainting isn't needed when running as non-root?
@ -52,6 +54,12 @@ while(@ARGV) {
elsif ($a eq "--no-prefix") {
$no_prefix = 1;
}
elsif ($a eq "--prefix") {
$set_prefix = &untaint(shift(@ARGV));
}
elsif ($a eq "--obsolete-wbm") {
$obsolete_wbm = 1;
}
elsif ($a eq "--licence" || $a eq "--license") {
$licence = &untaint(shift(@ARGV));
}
@ -79,9 +87,6 @@ while(@ARGV) {
elsif ($a eq "--rpm-dir") {
$basedir = &untaint(shift(@ARGV));
}
elsif ($a eq "--prefix") {
$set_prefix = &untaint(shift(@ARGV));
}
elsif ($a eq "--vendor") {
$vendor = &untaint(shift(@ARGV));
}
@ -97,6 +102,9 @@ while(@ARGV) {
elsif ($a eq "--exclude") {
push(@exclude, shift(@ARGV));
}
elsif ($a eq "--mod-list") {
$mod_list = shift(@ARGV);
}
elsif ($a =~ /^\-\-/) {
print STDERR "Unknown option $a\n";
exit(1);
@ -121,6 +129,7 @@ if (!$dir) {
print " [--rpm-dir directory]\n";
print " [--no-prefix]\n";
print " [--prefix prefix]\n";
print " [--no-wbm-prefix]\n";
print " [--vendor name]\n";
print " [--licence name]\n";
print " [--url url]\n";
@ -134,6 +143,7 @@ if (!$dir) {
print " [--sign]\n";
print " [--key keyname]\n";
print " [--exclude file]\n";
print " [--mod-list full|core|minimal]\n";
print RESET, "\n";
exit(1);
}
@ -164,7 +174,8 @@ if (!-d $spec_dir || !-d $rpm_source_dir || !-d $rpm_dir) {
# Is this actually a module or theme directory?
-d $source_dir || die "$dir is not a directory";
my ($depends, $prefix, $desc, $prog, $iver, $istheme, $post_config);
my ($depends, $prefix, $prefix_auto, $desc, $prog, $iver,
$istheme, $post_config);
if ($minfo{'desc'}) {
$depends = join(" ", map { s/\/[0-9\.]+//; $_ }
grep { !/^[0-9\.]+$/ }
@ -200,6 +211,7 @@ elsif ($tinfo{'desc'}) {
else {
die "$source_dir does not appear to be a webmin module or theme";
}
$prefix_auto = $prefix;
$prefix = "" if ($no_prefix);
$prefix = $set_prefix if ($set_prefix);
my $ucprog = ucfirst($prog);
@ -267,7 +279,7 @@ if ($rpmdepends && defined($minfo{'depends'})) {
my $curr_dir = $0;
($curr_dir) = $curr_dir =~ /^(.+)\/[^\/]+$/;
$curr_dir = "." if ($curr_dir !~ /^\//);
my $mod_def_file = "$curr_dir/mod_def_list.txt";
my $mod_def_file = "$curr_dir/mod_${mod_list}_list.txt";
next if (! -r $mod_def_file);
open(my $fh, '<', $mod_def_file) ||
die "Error opening \"$mod_def_file\" : $!\n";
@ -344,6 +356,12 @@ if (exists($minfo{'rpm_obsoletes'})) {
}
}
# Fix support for old module name prefixes
if ($obsolete_wbm) {
push(@rprovides, "$prefix_auto$mod");
push(@robsoletes, "$prefix_auto$mod");
}
# Create the SPEC file
my $vendorheader = $vendor ? "Vendor: $vendor" : "";
my $urlheader = $url ? "URL: $url" : "";
@ -360,7 +378,7 @@ Summary: $desc
Name: $prefix$mod
Version: $ver
Release: $release
Requires: /bin/sh /usr/bin/perl /usr/libexec/$prog $rdeps
Requires: /bin/sh /usr/bin/perl $prog $rdeps
EOF
print $SPEC "Recommends: $rrecom\n" if ($rrecom);
print $SPEC "Suggests: " . join(" ", @rsuggests) . "\n" if (@rsuggests);

View File

@ -90,7 +90,7 @@ 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)
AutoReq: 0
License: BSD-3-clause
License: BSD-3-Clause
Group: System/Tools
Source: http://www.webmin.com/download/$tarfile
Vendor: $rpm_maintainer

1
mod_core_list.txt Normal file
View File

@ -0,0 +1 @@
acl apache authentic-theme backup-config bind8 change-user cron dovecot fail2ban fdisk filemin firewalld fsdump gray-theme htaccess-htpasswd init logrotate logviewer lvm mailboxes mailcap mount mysql net package-updates passwd phpini postfix proc procmail proftpd quota servers software spam sshd status system-status time updown useradmin usermin webmin webmincron webminlog xterm

View File

@ -1 +0,0 @@
cron dfsadmin exports inetd init mount samba useradmin fdisk format proc webmin quota software pap acl apache lpadmin bind8 sendmail squid bsdexports hpuxexports net dhcpd custom servers time syslog mysql man inittab raid postfix webminlog postgresql xinetd status cpan pam nis shell fetchmail passwd at proftpd sshd heartbeat cluster-software cluster-useradmin qmailadmin stunnel usermin fsdump lvm procmail cluster-webmin firewall sgiexports openslp webalizer shorewall adsl-client updown ppp-client pptp-server pptp-client ipsec ldap-useradmin change-user cluster-shell cluster-cron spam htaccess-htpasswd logrotate cluster-passwd mailboxes ipfw sarg bandwidth cluster-copy backup-config smart-status idmapd krb5 smf ipfilter rbac tunnel zones cluster-usermin dovecot syslog-ng mailcap ldap-client phpini filter bacula-backup ldap-server exim tcpwrappers package-updates system-status webmincron shorewall6 iscsi-server iscsi-client gray-theme iscsi-target iscsi-tgtd bsdfdisk fail2ban authentic-theme firewalld filemin firewall6 logviewer xterm

1
mod_full_list.txt Normal file
View File

@ -0,0 +1 @@
acl adsl-client apache at authentic-theme backup-config bacula-backup bandwidth bind8 bsdexports bsdfdisk change-user cluster-copy cluster-cron cluster-passwd cluster-shell cluster-software cluster-useradmin cluster-usermin cluster-webmin cpan cron custom dfsadmin dhcpd dovecot exim exports fail2ban fdisk fetchmail filemin filter firewall firewall6 firewalld format fsdump gray-theme heartbeat hpuxexports htaccess-htpasswd idmapd inetd init inittab ipfilter ipfw ipsec iscsi-client iscsi-server iscsi-target iscsi-tgtd krb5 ldap-client ldap-server ldap-useradmin logrotate logviewer lpadmin lvm mailboxes mailcap man mount mysql net nis openslp package-updates pam pap passwd phpini postfix postgresql ppp-client pptp-client pptp-server proc procmail proftpd qmailadmin quota raid rbac samba sarg sendmail servers sgiexports shell shorewall shorewall6 smart-status smf software spam squid sshd status stunnel syslog syslog-ng system-status tcpwrappers time tunnel updown useradmin usermin webalizer webmin webmincron webminlog xinetd xterm zones

1
mod_minimal_list.txt Normal file
View File

@ -0,0 +1 @@
acl cron init inittab man proc servers system-status webmin webmincron webminlog

View File

@ -662,7 +662,7 @@ if [ ! -f "$config_dir/.pre-install" ]; then
fi
# Test if we have systemd system
systemctlcmd=$(which systemctl 2>/dev/null)
systemctlcmd=$(command -v systemctl 2>/dev/null || :)
if [ -x "$systemctlcmd" ]; then
initsys=$(cat /proc/1/comm 2>/dev/null)
if [ "$initsys" != "systemd" ]; then

View File

@ -2126,7 +2126,7 @@ if ($_[0] =~ /^\// || $_[0] =~ /^[a-z]:[\\\/]/i) {
else {
# Check each directory in the path
my %donedir;
foreach my $d (split($path_separator, $ENV{'PATH'})) {
foreach my $d (split($path_separator || ":", $ENV{'PATH'})) {
next if ($donedir{$d}++);
$d =~ s/$slash$// if ($d ne $slash);
my $t = &translate_filename("$d/$_[0]");