Compare commits

...

25 Commits
1.953 ... 1.954

Author SHA1 Message Date
Jamie Cameron
e1219d58cf New version bump 2020-07-26 11:51:59 -07:00
Jamie Cameron
db89c10c61 Use require to avoid duplicate function warnings 2020-07-25 17:56:16 -07:00
Jamie Cameron
591fbe8656 Also use the new stop flag to shut down cleanly on CentOS 8 2020-07-25 17:44:20 -07:00
Jamie Cameron
a257f33031 Merge branch 'master' of github.com:webmin/webmin 2020-07-24 13:42:39 -07:00
Jamie Cameron
0177ad2e88 Copy active default route to saved one when switching from DHCP https://github.com/webmin/webmin/issues/1266 2020-07-24 13:42:30 -07:00
Ilia Rostovtsev
49353baa58 If the redirect_prefix exists change redirect base to include the prefix #1271 2020-07-24 18:02:52 +03:00
Ilia Rostovtsev
a1ad0504f0 Fix to distinguish command from actual file https://github.com/authentic-theme/authentic-theme/issues/1485 2020-07-24 11:29:59 +03:00
Ilia Rostovtsev
917e30d04b Fix to use relative path if needed 2020-07-20 20:34:47 +03:00
Ilia Rostovtsev
c56591bd63 Fix to properly test default module 2020-07-20 16:26:11 +03:00
Jamie Cameron
fdb1a2909b Fail if module.info can't be read https://github.com/webmin/webmin/issues/1267 2020-07-18 20:50:16 -07:00
Jamie Cameron
b10a39fb50 World type may be lower case 2020-07-18 15:36:29 -07:00
Jamie Cameron
c7eaa36b24 Merge branch 'master' of github.com:webmin/webmin 2020-07-18 10:56:04 -07:00
Jamie Cameron
e18884150b Remove message about PAM perl module not being loaded 2020-07-18 10:52:50 -07:00
Ilia Rostovtsev
8d3bbdbb6e Check for new Postfix version correctly
https://www.virtualmin.com/node/69464

It would better to factor this functionality out in a separate sub
2020-07-18 19:20:58 +03:00
Jamie Cameron
2ee43178df Set parent section fields that would be set when reading the config 2020-07-17 09:53:22 -07:00
Jamie Cameron
76cc260c7e Merge branch 'master' of github.com:webmin/webmin 2020-07-12 15:11:46 -07:00
Jamie Cameron
b871dcf4c3 Don't show process detail that are for internal use only 2020-07-12 15:07:12 -07:00
Ilia Rostovtsev
1b0242c4e2 Fix to use input instead 2020-07-12 17:27:59 +03:00
Jamie Cameron
2f113ee72d Don't set HOME globally as it can confuse subsequent commands https://github.com/virtualmin/virtualmin-gpl/issues/183 2020-07-11 09:39:33 -07:00
Jamie Cameron
78b70f7e1f Handle case where no standard filters are defined 2020-07-10 19:13:21 -07:00
Jamie Cameron
c71cfc96f9 Handle case where there are no filters 2020-07-10 18:53:39 -07:00
Jamie Cameron
b7b09fcb7d Fix type detection if no info 2020-07-10 18:34:51 -07:00
Jamie Cameron
11a8bd2e55 Fix inverted cleanup of child PIDs 2020-07-10 17:35:46 -07:00
Jamie Cameron
3db98c7a2d Fix editing of rules in direct mode https://www.virtualmin.com/node/69443 2020-07-10 16:45:48 -07:00
Ilia Rostovtsev
3fa7141ae7 Fix CPU temp output #1253 https://github.com/authentic-theme/authentic-theme/issues/1481
https://sourceforge.net/p/webadmin/discussion/600155/thread/38946ad0d7/?limit=25#2479
https://github.com/webmin/webmin/issues/1253
2020-07-07 17:28:39 +03:00
28 changed files with 104 additions and 78 deletions

View File

@@ -29,7 +29,7 @@ Webmin can be installed in two different ways:
1. By downloading a pre-built package, available for different distributions (CentOS, Fedora, SuSE, Mandriva, Debian, Ubuntu, Solaris and [other](http://www.webmin.com/support.html)) from our [download page](http://webmin.com/download.html);
<kbd>Note: It is highly recommended to [add repository](https://doxfer.webmin.com/Webmin/Installation) to your system for having automatic updates.</kbd>
2. By downloading, extracting [source file](https://prdownloads.sourceforge.net/webadmin/webmin-1.953.tar.gz), and running [_setup.sh_](http://www.webmin.com/tgz.html) script, with no arguments, which will setup to run it directly from this directory, or with a command-line argument, such as targeted directory.
2. By downloading, extracting [source file](https://prdownloads.sourceforge.net/webadmin/webmin-1.954.tar.gz), and running [_setup.sh_](http://www.webmin.com/tgz.html) script, with no arguments, which will setup to run it directly from this directory, or with a command-line argument, such as targeted directory.
<kbd>Note: If you are installing Webmin [on Windows](http://www.webmin.com/windows.html) system, you must run the command `perl setup.pl` instead. The Windows version depends on several programs, and modules that may not be part of the standard distribution. You will need _process.exe_ commmand, _sc.exe_ command, and _Win32::Daemon_ Perl module.</kbd>
## Documentation

View File

@@ -1,7 +1,7 @@
use strict;
use warnings;
do 'acl-lib.pl';
require 'acl-lib.pl';
our ($config_directory, %gconfig);
# backup_config_files()

View File

@@ -1,5 +1,5 @@
do 'adsl-client-lib.pl';
require 'adsl-client-lib.pl';
# backup_config_files()
# Returns files and directories that can be backed up

View File

@@ -1057,8 +1057,9 @@ foreach $f (@{$_[0]}) {
push(@fl, $f) if (&indexof($f, @fl) < 0);
}
foreach $f (&unique(@fl)) {
$rv .= &ui_checkbox($_[1], $f, $f, (&indexof($f, @{$_[0]}) < 0 ? 0 : 1 ) );
$rv .= &ui_checkbox($_[1], $f, $f, (&indexof($f, @{$_[0]}) < 0 ? 0 : 1 ) );
}
$rv ||= &ui_textbox($_[1], "", 20);
return $rv;
}

View File

@@ -1,5 +1,5 @@
do 'apache-lib.pl';
require 'apache-lib.pl';
# backup_config_files()
# Returns files and directories that can be backed up

View File

@@ -837,8 +837,8 @@ return &parse_opt("ForceType", '^\S+\/\S+$', $text{'mod_mime_etype'});
sub edit_SetOutputFilter
{
local @vals = split(/[\s;]+/, $_[0]->{'value'});
return (2, $text{'core_outfilter'},
&filters_input(\@vals, "SetOutputFilter"));
my $fi = &filters_input(\@vals, "SetOutputFilter");
return (2, $text{'core_outfilter'}, $fi);
}
sub save_SetOutputFilter
{
@@ -848,8 +848,8 @@ return &parse_filters("SetOutputFilter");
sub edit_SetInputFilter
{
local @vals = split(/[\s;]+/, $_[0]->{'value'});
return (2, $text{'core_infilter'},
&filters_input(\@vals, "SetInputFilter"));
my $fi = &filters_input(\@vals, "SetInputFilter");
return (2, $text{'core_infilter'}, $fi);
}
sub save_SetInputFilter
{

View File

@@ -1,5 +1,5 @@
do 'cron-lib.pl';
require 'cron-lib.pl';
# backup_config_files()
# Returns files and directories that can be backed up

View File

@@ -308,7 +308,9 @@ if ($file !~ /^\// && $file !~ /\|\s*$/) {
$file = "$uinfo[7]/$file";
}
}
open(FILE, "<".$file);
my $h;
$h = "<" if ($file =~ /^\// && $file !~ /\|\s*$/);
open(FILE, "$h".$file);
while(<FILE>) {
s/\r|\n//g;
next if (/^#/);

View File

@@ -295,6 +295,8 @@ my $i = 1;
foreach my $m (@{$section->{'members'}}) {
$m->{'line'} = $m->{'eline'} = $section->{'line'} + $i++;
$m->{'file'} = $section->{'file'};
$m->{'sectionname'} = $section->{'name'};
$m->{'sectionvalue'} = $section->{'value'};
}
}

View File

@@ -60,13 +60,13 @@ local $lnum = 0;
local $direct = "ip${ipvx}tables-save 2>/dev/null |";
if (!$file) {
# Use default file
$file = $config{"direct${ipvx}"} ? $direct : $ipvx_save;
$file = $config{"direct${ipvx}"} ? $direct : "<".$ipvx_save;
}
elsif ($file eq "direct") {
# Read active rules
$file = $direct;
}
open(FILE, "<".$file);
open(FILE, $file);
local $cmt;
LINE:
while(<FILE>) {

View File

@@ -1,5 +1,5 @@
do 'iscsi-server-lib.pl';
require 'iscsi-server-lib.pl';
# backup_config_files()
# Returns files and directories that can be backed up

View File

@@ -1,6 +1,6 @@
# install_check.pl
do 'iscsi-server-lib.pl';
require 'iscsi-server-lib.pl';
# is_installed(mode)
# For mode 1, returns 2 if the server is installed and configured for use by

View File

@@ -1,7 +1,7 @@
# log_parser.pl
# Functions for parsing this module's logs
do 'iscsi-server-lib.pl';
require 'iscsi-server-lib.pl';
# parse_webmin_log(user, script, action, type, object, &params)
# Converts logged information from this module into human-readable form

View File

@@ -4,13 +4,10 @@ sub show_userIgnoreList
{
my($ig_usr) = shift(@_) || '';
$ig_usr =~ s/\t/\n/g;
my($preta) = '<TEXTAREA NAME="ignore_users" COLS="35" ROWS="4">';
my($postta) = '</TEXTAREA>';
my($preta) = "<input name=\"ignore_users\" value=\"$ig_usr\" size=\"50\">";
return
$preta .
$ig_usr .
$postta .
'&nbsp;' .
&user_chooser_button("ignore_users", 1);
}

View File

@@ -52,34 +52,14 @@ if ($min) {
}
else {
# All the modules
@mlist =
("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", "telnet", "servers",
"time", "wuftpd", "syslog", "mysql", "man",
"inittab", "raid", "postfix", "webminlog", "postgresql", "xinetd",
"status", "cpan", "pam", "nis", "shell", "grub",
"fetchmail", "passwd", "at", "proftpd", "sshd",
"heartbeat", "cluster-software", "cluster-useradmin", "qmailadmin",
"mon", "jabber", "stunnel", "usermin",
"fsdump", "lvm", "procmail",
"cluster-webmin", "firewall", "sgiexports", "vgetty", "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", "blue-theme", "ldap-client", "phpini", "filter",
"bacula-backup", "ldap-server", "exim", "tcpwrappers",
"package-updates", "system-status", "webmincron", "ajaxterm",
"shorewall6", "iscsi-server", "iscsi-client", "gray-theme",
"iscsi-target", "iscsi-tgtd", "bsdfdisk", "fail2ban",
"authentic-theme", "firewalld", "filemin", "firewall6",
);
my $mod_def_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> };
close($fh);
@mlist = split(/\s+/, $mod_def_list);
}
@dirlist = ( "WebminUI", "JSON" );

View File

@@ -231,9 +231,18 @@ if ($debdepends && exists($minfo{'depends'})) {
# If the module is part of Webmin, we don't need to depend on it
if ($dmod) {
my %dinfo;
read_file("$dmod/module.info", \%dinfo);
next if ($dinfo{'longdesc'});
my $mod_def_list;
my @mod_def_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> };
close($fh);
@mod_def_list = split(/\s+/, $mod_def_list);
if ( grep( /^$dmod$/, @mod_def_list ) ) {
next;
}
}
push(@rdeps, $dwebmin ? ("$product (>= $dwebmin)") :
$dver ? ("$prefix$dmod (>= $dver)") :

View File

@@ -246,9 +246,18 @@ if ($rpmdepends && defined($minfo{'depends'})) {
# If the module is part of Webmin, we don't need to depend on it
if ($dmod) {
my %dinfo;
&read_file("$dmod/module.info", \%dinfo);
next if ($dinfo{'longdesc'});
my $mod_def_list;
my @mod_def_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> };
close($fh);
@mod_def_list = split(/\s+/, $mod_def_list);
if ( grep( /^$dmod$/, @mod_def_list ) ) {
next;
}
}
push(@rdeps, $dwebmin ? ("webmin", ">=", $dwebmin) :
$dver ? ($prefix.$dmod, ">=", $dver) :

View File

@@ -24,7 +24,7 @@ print &ui_table_row($text{'conf_seed'},
# Type for new worlds
my $type = &find_value("level-type", $conf) || "DEFAULT";
print &ui_table_row($text{'conf_type'},
&ui_select("type", $type,
&ui_select("type", uc($type),
[ [ "DEFAULT", $text{'conf_type_default'} ],
[ "FLAT", $text{'conf_type_flat'} ],
[ "AMPLIFIED", $text{'conf_type_amplified'} ],

View File

@@ -170,16 +170,11 @@ elsif (!$config{'no_pam'}) {
"PAM initialization of Authen::PAM failed");
}
}
else {
push(@startup_msg,
"Perl module Authen::PAM needed for PAM is ".
"not installed : $@");
}
}
if ($config{'pam_only'} && !$use_pam) {
foreach $msg (@startup_msg) {
print STDERR $msg,"\n";
}
print STDERR $msg,"\n";
}
print STDERR "PAM use is mandatory, but could not be enabled!\n";
print STDERR "no_pam and pam_only both are set!\n" if ($config{no_pam});
exit(1);
@@ -783,7 +778,7 @@ while(1) {
do { $pid = waitpid(-1, WNOHANG);
@childpids = grep { $_ != $pid } @childpids;
} while($pid != 0 && $pid != -1);
@childpids = grep { !kill(0, $_) } @childpids;
@childpids = grep { kill(0, $_) } @childpids;
# run the unblocking procedure to check if enough time has passed to
# unblock hosts that heve been blocked because of password failures
@@ -1538,6 +1533,11 @@ $portstr = $redirport == 80 && !$ssl ? "" :
$redirhost = $config{'redirect_host'} || $host;
$hostport = &check_ip6address($redirhost) ? "[".$redirhost."]".$portstr
: $redirhost.$portstr;
# If the redirect_prefix exists change redirect base to include the prefix #1271
if ($config{'redirect_prefix'}) {
$hostport .= $config{'redirect_prefix'}
}
$prot = $ssl ? "https" : "http";
undef(%in);

1
mod_def_list.txt Normal file
View File

@@ -0,0 +1 @@
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 telnet servers time wuftpd syslog mysql man inittab raid postfix webminlog postgresql xinetd status cpan pam nis shell grub fetchmail passwd at proftpd sshd heartbeat cluster-software cluster-useradmin qmailadmin mon jabber stunnel usermin fsdump lvm procmail cluster-webmin firewall sgiexports vgetty 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 blue-theme ldap-client phpini filter bacula-backup ldap-server exim tcpwrappers package-updates system-status webmincron ajaxterm shorewall6 iscsi-server iscsi-client gray-theme iscsi-target iscsi-tgtd bsdfdisk fail2ban authentic-theme firewalld filemin firewall6

View File

@@ -325,10 +325,21 @@ else {
}
else {
$b->{'fullname'} = $b->{'name'}.
( $b->{'virtual'} eq '' ? '' : ':'.$b->{'virtual'});
( $b->{'virtual'} eq '' ? '' : ':'.$b->{'virtual'});
}
&save_interface($b, \@boot);
# If switching from DHCP to static and there is no default gateway
# set, copy the active one
if ($oldb{'dhcp'} && !$b{'dhcp'} && $b{'virtual'} eq '' &&
defined(&get_default_gateway) && defined(&list_routes)) {
my $oldgw = &get_default_gateway();
my ($dr) = grep { $_->{'dest'} eq '0.0.0.0' } &list_routes();
if (!$oldgw && $dr) {
&set_default_gateway($dr->{'gateway'}, $b{'name'});
}
}
if ($in{'activate'}) {
# Make this interface active (if possible)
&error_setup($text{'bifc_err3'});

View File

@@ -16,11 +16,13 @@ $config{'perpage'} ||= 20; # a value of 0 can cause problems
# Get the saved version number
$version_file = "$module_config_directory/version";
$postfix_config_command = $config{'postfix_config_command'};
$has_postfix_config_command = &has_command($postfix_config_command);
if (&open_readfile(VERSION, $version_file)) {
chop($postfix_version = <VERSION>);
close(VERSION);
my @vst = stat($version_file);
my @cst = stat(&has_command($config{'postfix_config_command'}));
my @cst = stat($postfix_config_command);
if (@cst && $cst[9] > $vst[9]) {
# Postfix was probably upgraded
$postfix_version = undef;
@@ -29,8 +31,8 @@ if (&open_readfile(VERSION, $version_file)) {
if (!$postfix_version) {
# Not there .. work it out
if (&has_command($config{'postfix_config_command'}) &&
&backquote_command("$config{'postfix_config_command'} -d mail_version 2>&1", 1) =~ /mail_version\s*=\s*(.*)/) {
if ($has_postfix_config_command &&
&backquote_command("$postfix_config_command -d mail_version 2>&1", 1) =~ /mail_version\s*=\s*(.*)/) {
# Got the version
$postfix_version = $1;
}

View File

@@ -1218,7 +1218,7 @@ if (&supports_pgpass()) {
&make_dir($temphome, 0755);
$pgpass = "$temphome/.pgpass";
push(@main::temporary_files, $pgpass);
$ENV{'HOME'} = $temphome;
$cmd = "HOME=$temphome $cmd";
}
$ENV{'PGPASSFILE'} = $pgpass;
open(PGPASS, ">$pgpass");

View File

@@ -76,7 +76,7 @@ print &ui_form_end();
# Extra OS-specific info
foreach $k (keys %pinfo) {
if ($k =~ /^_/) {
if ($k =~ /^_/ && $info_arg_map{$k}) {
print &ui_table_row($info_arg_map{$k}, $pinfo{$k});
}
}

View File

@@ -496,21 +496,30 @@ sub get_current_cpu_temps
my @rv;
if (&has_command("sensors")) {
my $fh = "SENSORS";
my $a;
&open_execute_command($fh, "sensors </dev/null 2>/dev/null", 1);
while(<$fh>) {
if (/Core\s+(\d+):\s+([\+\-][0-9\.]+)/) {
push(@rv, { 'core' => $1,
'temp' => $2 });
}
elsif (/temp(\d+):\s+([\+\-][0-9\.]+)/) {
# Adjust to start from `0` as all other outputs
push(@rv, { 'core' => (int($1) - 1),
'temp' => $2 });
}
elsif (/CPU:\s+([\+\-][0-9\.]+)/) {
push(@rv, { 'core' => 0,
'temp' => $1 });
}
else {
# New line - new device (disallow, if no either fan or voltage data)
$a = 0 if (/^\s*$/);
# Device has either fan or voltage data (sign of CPU)
$a = 1 if (/fan[\d+]:\s+[0-9]+\s+RPM/i ||
/in[\d+]:\s+[\+\-0-9\.]+\s+V/i);
# Get odd output like in #1253
if ($a && /temp(\d+):\s+([\+\-][0-9\.]+)\s+.*?[=+].*?\)/) {
# Adjust to start from `0` as all other outputs
push(@rv, { 'core' => (int($1) - 1),
'temp' => $2 });
}
}
}
close($fh);
}

View File

@@ -620,8 +620,9 @@ echo "pidfile=\`grep \"^pidfile=\" $config_dir/miniserv.conf | sed -e 's/pidfile
echo "pid=\`cat \$pidfile\`" >>$config_dir/stop
echo "if [ \"\$pid\" != \"\" ]; then" >>$config_dir/stop
echo " kill \$pid || exit 1" >>$config_dir/stop
echo " touch $var_dir/stop-flag" >>$config_dir/stop
echo " if [ \"\$1\" = \"--kill\" ]; then" >>$config_dir/stop
echo " sleep 1" >>$config_dir/stop
echo " sleep 2" >>$config_dir/stop
echo " (kill -9 -- -\$pid || kill -9 \$pid) 2>/dev/null" >>$config_dir/stop
echo " fi" >>$config_dir/stop
echo " exit 0" >>$config_dir/stop

View File

@@ -1 +1 @@
1.953
1.954

View File

@@ -1879,8 +1879,10 @@ while(<OUT>) {
}
}
close(OUT);
$rv{'type'} = $rv{'o'} eq $rv{'issuer_o'} ? $text{'ssl_typeself'}
: $text{'ssl_typereal'};
if ($rv{'o'} && $rv{'issuer_o'}) {
$rv{'type'} = $rv{'o'} eq $rv{'issuer_o'} ? $text{'ssl_typeself'}
: $text{'ssl_typereal'};
}
return \%rv;
}