From: Dominik Csapak Date: Fri, 12 Feb 2016 10:43:23 +0000 (+0100) Subject: limit vmid with JSON format X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=50ae94c97b77ad6352957b9be32686572f205031 limit vmid with JSON format if we do not do this, vmids < 100 (not really bad) and vmids > 999999999 are possible, which can lead to vms which you can only get rid of, if you delete the config files manually also this makes the api consistent with the webgui for vmids Signed-off-by: Dominik Csapak --- diff --git a/src/PVE/JSONSchema.pm b/src/PVE/JSONSchema.pm index 9552925..15e2c3c 100644 --- a/src/PVE/JSONSchema.pm +++ b/src/PVE/JSONSchema.pm @@ -137,7 +137,7 @@ register_format('pve-vmid', \&pve_verify_vmid); sub pve_verify_vmid { my ($vmid, $noerr) = @_; - if ($vmid !~ m/^[1-9][0-9]+$/) { + if ($vmid !~ m/^[1-9][0-9]{2,8}$/) { return undef if $noerr; die "value does not look like a valid VM ID\n"; }