nexenta: nexenta_get_zvol_size : parse result to avoid tainted value

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
Alexandre Derumier
2013-05-27 11:41:37 +02:00
committed by Dietmar Maurer
parent c55a499dfe
commit 0b79e98ccb

View 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 {