]> git.proxmox.com Git - pve-common.git/commitdiff
schema: disable additional properties in property strings
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 11 Feb 2016 10:21:00 +0000 (11:21 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 11 Feb 2016 11:03:00 +0000 (12:03 +0100)
Changed the default additional_properties parameter when
verifying them from undefined (which defaults to 1) to 0.

parse_property_strings() now takes an optional
additional_properties parameter, too.

debian/changelog
src/PVE/JSONSchema.pm

index 50d02c625af037c5530681655d416545ccc52bf4..c4d650f58f7e1b60517477e1dc6ecf8e645af8fd 100644 (file)
@@ -2,6 +2,8 @@ libpve-common-perl (4.0-48) unstable; urgency=medium
 
   * added syncfs syscall and sync_mountpoint helper
 
+  * Applying: schema: disable additional properties in property strings
+
  -- Proxmox Support Team <support@proxmox.com>  Thu, 11 Feb 2016 11:24:34 +0100
 
 libpve-common-perl (4.0-47) unstable; urgency=medium
index a9a5400593c0954c2a3cc62ff76d8914744e1ed5..95529258f19c24535e09dae21dc54471da8b1d37 100644 (file)
@@ -488,7 +488,10 @@ sub format_size {
 };
 
 sub parse_property_string {
-    my ($format, $data, $path) = @_;
+    my ($format, $data, $path, $additional_properties) = @_;
+
+    # In property strings we default to not allowing additional properties
+    $additional_properties = 0 if !defined($additional_properties);
 
     my $default_key;
 
@@ -528,7 +531,7 @@ sub parse_property_string {
     }
 
     my $errors = {};
-    check_object($path, $format, $res, undef, $errors);
+    check_object($path, $format, $res, $additional_properties, $errors);
     if (scalar(%$errors)) {
        raise "format error\n", errors => $errors;
     }