Compare commits

...

11 Commits
1.950 ... 1.951

Author SHA1 Message Date
Jamie Cameron
396075b4d9 Minor version bump 2020-07-02 18:59:48 -07:00
Ilia Rostovtsev
1f7d2b0b88 Merge branch 'master' of github.com:webmin/webmin 2020-07-02 22:41:04 +03:00
Ilia Rostovtsev
a43ba8cce5 Fix to add missing dummy JSON::PP::Boolean
https://sourceforge.net/p/webadmin/discussion/600155/
2020-07-02 22:40:33 +03:00
Jamie Cameron
c98135b6da Add forgotten file 2020-07-01 15:10:30 -07:00
Ilia Rostovtsev
cbc9c26194 Load ./lib only once in -lib file 2020-07-01 20:43:36 +03:00
Ilia Rostovtsev
abcec01b0c Load ./lib only once in -lib file 2020-07-01 20:42:35 +03:00
Ilia Rostovtsev
3cf18c8807 Use forgotten local lib too 2020-07-01 20:28:14 +03:00
Ilia Rostovtsev
2f2d0d0859 Load File::MimeInfo; in a lib file 2020-07-01 02:05:29 +03:00
Jamie Cameron
645daaf0cd Needed to show error messages properly in non-SSL mode 2020-06-30 15:02:29 -07:00
Jamie Cameron
3c99bdd9b5 Revert back to using the mime module, but ensure it never returns utf-8 strings 2020-06-30 14:27:13 -07:00
Jamie Cameron
5680320c0c Don't use a separate mime library, as sometimes it returns utf-8 encoded types 2020-06-30 13:07:24 -07:00
13 changed files with 95 additions and 18 deletions

42
JSON/PP/Boolean.pm Normal file
View File

@@ -0,0 +1,42 @@
package JSON::PP::Boolean;
use strict;
require overload;
local $^W;
overload::import('overload',
"0+" => sub { ${$_[0]} },
"++" => sub { $_[0] = ${$_[0]} + 1 },
"--" => sub { $_[0] = ${$_[0]} - 1 },
fallback => 1,
);
$JSON::PP::Boolean::VERSION = '4.04';
1;
__END__
=head1 NAME
JSON::PP::Boolean - dummy module providing JSON::PP::Boolean
=head1 SYNOPSIS
# do not "use" yourself
=head1 DESCRIPTION
This module exists only to provide overload resolution for Storable and similar modules. See
L<JSON::PP> for more info about this class.
=head1 AUTHOR
This idea is from L<JSON::XS::Boolean> written by Marc Lehmann <schmorp[at]schmorp.de>
=head1 LICENSE
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
=cut

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.950.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.951.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,6 @@
#!/usr/local/bin/perl
require './filemin-lib.pl';
use lib './lib';
&ReadParse();

View File

@@ -1,7 +1,6 @@
#!/usr/local/bin/perl
require './filemin-lib.pl';
use lib './lib';
&ReadParse();

View File

@@ -1,7 +1,6 @@
#!/usr/local/bin/perl
require './filemin-lib.pl';
use lib './lib';
use File::Basename;
use Cwd 'abs_path';

View File

@@ -1,14 +1,12 @@
#!/usr/local/bin/perl
require './filemin-lib.pl';
use lib './lib';
use File::MimeInfo;
&ReadParse();
get_paths();
$archive_type = mimetype($cwd.'/'.$in{'file'});
$archive_type = clean_mimetype($cwd.'/'.$in{'file'});
if ($archive_type =~ /x-bzip/) {
$cmd = "tar xvjfp ".quotemeta("$cwd/$in{'file'}").

View File

@@ -3,9 +3,12 @@
BEGIN { push(@INC, ".."); };
use WebminCore;
&init_config();
use lib './lib';
use POSIX;
use Encode qw(decode encode);
use File::Basename;
use POSIX;
use File::MimeInfo;
sub get_attr_status {
return has_command('lsattr');
@@ -433,4 +436,12 @@ $error && &error(&text('notallowed', '`' . &html_escape($file) . '`',
'`' . &html_escape(join(" , ", @allowed_paths)) . '`.'));
}
sub clean_mimetype
{
my ($f) = @_;
my $t = mimetype($f);
eval { utf8::encode($t) if (utf8::is_utf8($t)) };
return $t;
}
1;

View File

@@ -1,7 +1,6 @@
#!/usr/local/bin/perl
require './filemin-lib.pl';
use lib './lib';
&ReadParse();
get_paths();

View File

@@ -2,9 +2,6 @@
# File manager written in perl
require './filemin-lib.pl';
use lib './lib';
use File::MimeInfo;
&ReadParse();
get_paths();
@@ -58,7 +55,7 @@ unless (opendir ( DIR, $cwd )) {
}
# Get info about directory entries
@info = map { [ $_, lstat($_), &mimetype($_), -d, -l $_, $secontext{$_}, $attributes{$_} ] } @list;
@info = map { [ $_, lstat($_), &clean_mimetype($_), -d, -l $_, $secontext{$_}, $attributes{$_} ] } @list;
# Filter out folders
@folders = map {$_} grep {$_->[15] == 1 } @info;

View File

@@ -1,8 +1,6 @@
#!/usr/local/bin/perl
require './filemin-lib.pl';
use lib './lib';
use File::MimeInfo;
&ReadParse();
@@ -21,7 +19,7 @@ if($in{'caseins'}) {
}
@list = split('\n', &backquote_logged(
"find ".quotemeta($cwd)." $criteria ".quotemeta("*$in{'query'}*")));
@list = map { [ $_, stat($_), mimetype($_), -d $_ ] } @list;
@list = map { [ $_, stat($_), &clean_mimetype($_), -d $_ ] } @list;
print_interface();

View File

@@ -2478,7 +2478,7 @@ if (&get_type($full) eq "internal/cgi" && $validated != 4) {
if ($@) {
# Error in perl!
&http_error(500, "Perl execution failed",
$config{'noshowstderr'} ? undef : $@);
$config{'noshowstderr'} ? undef : "$@");
}
elsif (!$doneheaders && !$nph_script) {
&http_error(500, "Missing Headers");

35
postfix/save_opts_sni.cgi Executable file
View File

@@ -0,0 +1,35 @@
#!/usr/local/bin/perl
#
# postfix-module by Guillaume Cottenceau <gc@mandrakesoft.com>,
# for webmin by Jamie Cameron
#
# Save Postfix options ; special because for sni tables
require './postfix-lib.pl';
&ReadParse();
$access{'sni'} || &error($text{'sni_ecannot'});
&error_setup($text{'opts_err'});
&lock_postfix_files();
&before_save();
&save_options(\%in);
&ensure_map("tls_server_sni_maps");
&after_save();
&unlock_postfix_files();
&regenerate_sni_table();
$err = &reload_postfix();
&error($err) if ($err);
&webmin_log("sni");
&redirect("");

View File

@@ -1 +1 @@
1.950
1.951