nexenta: nexenta_get_zvol_size : parse result to avoid tainted value
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
committed by
Dietmar Maurer
parent
c55a499dfe
commit
0b79e98ccb
@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user