]> git.proxmox.com Git - pve-common.git/blobdiff - src/PVE/SectionConfig.pm
improve asciidoc markup
[pve-common.git] / src / PVE / SectionConfig.pm
index f6646f3398a1ec69e9e6c3ae1a71025641d4fbc4..95e166abce88d8101368ee93213b7dda33532525 100644 (file)
@@ -68,7 +68,6 @@ sub createSchema {
     };
 
     foreach my $p (keys %$propertyList) {
-       next if $p eq 'type';
        if (!$propertyList->{$p}->{optional}) {
            $props->{$p} = $propertyList->{$p};
            next;
@@ -119,6 +118,9 @@ sub updateSchema {
 
        my $modifyable = 0;
 
+       my $copts = $class->options();
+       $modifyable = 1 if defined($copts->{$p}) && !$copts->{$p}->{fixed};
+
        foreach my $t (keys %$plugins) {
            my $opts = $pdata->{options}->{$t} || {};
            next if !defined($opts->{$p});
@@ -391,6 +393,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 {