X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=blobdiff_plain;f=src%2FPVE%2FSectionConfig.pm;h=6f85b228b81ec82c77d64fbbbc8f0197e5274e01;hp=71d296e6574f7a11d47a67083a45c5188c1b4887;hb=ebd2b0aca54022f80abfbea0167d1ac2143f4771;hpb=771d18f5c7be2055f0c9012f7f921f6d5f6337db diff --git a/src/PVE/SectionConfig.pm b/src/PVE/SectionConfig.pm index 71d296e..6f85b22 100644 --- a/src/PVE/SectionConfig.pm +++ b/src/PVE/SectionConfig.pm @@ -26,6 +26,9 @@ sub register { my $type = $class->type(); my $pdata = $class->private(); + die "duplicate plugin registration (type = $type)" + if defined($pdata->{plugins}->{$type}); + my $plugindata = $class->plugindata(); $pdata->{plugindata}->{$type} = $plugindata; $pdata->{plugins}->{$type} = $class; @@ -393,6 +396,9 @@ my $format_config_line = sub { my $ct = $schema->{type}; + die "property '$key' contains a line feed\n" + if ($key =~ m/[\n\r]/) || ($value =~ m/[\n\r]/); + if ($ct eq 'boolean') { return $value ? "\t$key\n" : ''; } else {