]> git.proxmox.com Git - pve-storage.git/blobdiff - PVE/Storage/NexentaPlugin.pm
nexenta: nexenta_get_zvol_size : parse result to avoid tainted value
[pve-storage.git] / PVE / Storage / NexentaPlugin.pm
index 857df542298286136eea028fabd94fc7fef1c1d3..93cd0cffc50298812fdd79796b5f1697dbb7f438 100644 (file)
@@ -42,7 +42,10 @@ sub nexenta_request {
 sub nexenta_get_zvol_size {
     my ($scfg, $zvol) = @_;
 
-    return nexenta_request($scfg, 'get_child_prop', 'zvol', $zvol, 'size_bytes');
+    my $ret = nexenta_request($scfg, 'get_child_prop', 'zvol', $zvol, 'size_bytes');
+    $ret =~ m/^(\d+)$/ or die "size is not valid";
+    my $size = $1;
+    return $size;
 }
 
 sub nexenta_get_zvol_props {