mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 14:13:29 +00:00
Add die handler that stores the error from eval message
This commit is contained in:
@@ -34,5 +34,12 @@ if (!$done_web_lib_funcs) {
|
||||
$remote_error_handler ||= \&error;
|
||||
$main::remote_error_handler ||= \&error;
|
||||
|
||||
# Die handler that stores the error from
|
||||
# eval message in a global variable
|
||||
$SIG{__DIE__} = sub {
|
||||
# Don't meddle with the natural functioning of eval.
|
||||
$main::error_last_eval = $_[0] if (!$^S);
|
||||
};
|
||||
|
||||
1;
|
||||
|
||||
|
||||
@@ -162,8 +162,7 @@ sub validate_twofactor_apikey_totp
|
||||
{
|
||||
my ($miniserv, $in) = @_;
|
||||
eval "use Authen::OATH";
|
||||
$main::error_last_eval = $@;
|
||||
if ($main::error_last_eval) {
|
||||
if ($@) {
|
||||
return &text('twofactor_etotpmodule', 'Authen::OATH',
|
||||
"../cpan/download.cgi?source=3&cpan=Authen::OATH&mode=2&".
|
||||
"return=/$module_name/&returndesc=".&urlize($text{'index_return'}));
|
||||
@@ -249,8 +248,7 @@ $id =~ /^[A-Z0-9=]+$/i || return $text{'twofactor_etotpid'};
|
||||
$token =~ /^\d+$/ || return $text{'twofactor_etotptoken'};
|
||||
eval "use lib (\"$root_directory/vendor_perl\")";
|
||||
eval "use Authen::OATH";
|
||||
$main::error_last_eval = $@;
|
||||
if ($main::error_last_eval) {
|
||||
if ($@) {
|
||||
return &text('twofactor_etotpmodule2', 'Authen::OATH');
|
||||
}
|
||||
my $secret = &decode_base32($id);
|
||||
|
||||
Reference in New Issue
Block a user