From 50ae94c97b77ad6352957b9be32686572f205031 Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Fri, 12 Feb 2016 11:43:23 +0100 Subject: [PATCH] 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 --- src/PVE/JSONSchema.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"; } -- 2.39.2