diff --git a/README.md b/README.md index 29a7fdb..416d7cd 100644 --- a/README.md +++ b/README.md @@ -19,11 +19,6 @@ Please be aware that this enhancment uses the FreeNAS APIs and NOT the ssh/scp l cp perl5/PVE/Storage/LunCmd/FreeNAS.pm /usr/share/perl5/PVE/Storage/LunCmd/FreeNAS.pm ``` -1. Remove the `-T` taint directive from `/usr/bin/pvedaemon`. Not sure why this is needed. I need to do some research on this PERL directive option. - ```bash - sed -E -i.orig 's|^(#!/usr/bin/perl) -T|\1|' /usr/bin/pvedaemon - ``` - 1. Execute the following at a console command prompt to active the above ```bash systemctl restart pvedaemon diff --git a/perl5/PVE/Storage/LunCmd/FreeNAS.pm b/perl5/PVE/Storage/LunCmd/FreeNAS.pm index 95ffe4a..84c961e 100644 --- a/perl5/PVE/Storage/LunCmd/FreeNAS.pm +++ b/perl5/PVE/Storage/LunCmd/FreeNAS.pm @@ -437,7 +437,8 @@ sub freenas_list_lu { my $targets = freenas_iscsi_get_target($scfg); my $target_id = freenas_get_targetid($scfg); - my @luns = (); + my @luns = (); + my $iscsi_lunid = undef; if(defined($target_id)) { my $target2extents = freenas_iscsi_get_target_to_extent($scfg); @@ -447,8 +448,14 @@ sub freenas_list_lu { if($item->{'iscsi_target'} == $target_id) { foreach my $node (@$extents) { if($node->{'id'} == $item->{'iscsi_extent'}) { - $node->{'iscsi_lunid'} .= $item->{'iscsi_lunid'}; - push( @luns , $node); + if ($item->{'iscsi_lunid'} =~ /(\d+)/) { + my $iscsi_lunid = "$1"; + } else { + syslog("info", "FreeNAS::API::freenas_list_lu : iscsi_lunid did not pass tainted testing"); + next; + } + $node->{'iscsi_lunid'} .= $iscsi_lunid; + push(@luns , $node); } } }