]> git.proxmox.com Git - pve-storage.git/blobdiff - PVE/Storage/ZFSPlugin.pm
ZFSPlugin: untaint lun number
[pve-storage.git] / PVE / Storage / ZFSPlugin.pm
index 383f0a0cde932da5ce34d792aafb7206517b74ee..63b95517adad6a544bd15ba1d06328e1fcf9119a 100644 (file)
@@ -159,7 +159,11 @@ sub zfs_get_lun_number {
 
     die "could not find lun_number for guid $guid" if !$guid;
 
-    return $class->zfs_request($scfg, undef, 'list_view', $guid);
+    if ($class->zfs_request($scfg, undef, 'list_view', $guid) =~ /^(\d+)$/) {
+       return $1;
+    }
+
+    die "lun_number for guid $guid is not a number";
 }
 
 # Configuration