INotify.pm: use Clone::clone instead of Storable::dclone

I run into seroius troubles with dclone, which seem to be
buggy with tainted flag ...

Also, documentation states Clone::clone is much faster.
This commit is contained in:
Dietmar Maurer 2017-03-21 11:56:49 +01:00
parent e04b9f4c43
commit 32ef45aee2

View File

@ -15,7 +15,7 @@ use PVE::SafeSyslog;
use PVE::Exception qw(raise_param_exc); use PVE::Exception qw(raise_param_exc);
use PVE::Tools; use PVE::Tools;
use PVE::ProcFSTools; use PVE::ProcFSTools;
use Storable qw(dclone); use Clone qw(clone);
use Linux::Inotify2; use Linux::Inotify2;
use base 'Exporter'; use base 'Exporter';
use JSON; use JSON;
@ -247,7 +247,7 @@ sub read_file {
my $ret; my $ret;
if (!$noclone && ref ($ccinfo->{data})) { if (!$noclone && ref ($ccinfo->{data})) {
$ret->{data} = dclone ($ccinfo->{data}); $ret->{data} = clone ($ccinfo->{data});
} else { } else {
$ret->{data} = $ccinfo->{data}; $ret->{data} = $ccinfo->{data};
} }
@ -269,7 +269,7 @@ sub read_file {
} }
# we cache data with references, so we always need to # we cache data with references, so we always need to
# dclone this data. Else the original data may get # clone this data. Else the original data may get
# modified. # modified.
$ccinfo->{data} = $res; $ccinfo->{data} = $res;
@ -278,7 +278,7 @@ sub read_file {
my $ret; my $ret;
if (!$noclone && ref ($ccinfo->{data})) { if (!$noclone && ref ($ccinfo->{data})) {
$ret->{data} = dclone ($ccinfo->{data}); $ret->{data} = clone ($ccinfo->{data});
} else { } else {
$ret->{data} = $ccinfo->{data}; $ret->{data} = $ccinfo->{data};
} }