Commit f026b166 authored by Dietmar Maurer's avatar Dietmar Maurer

openvz: add check for newlines before writing configuration

parent 4b51d87a
...@@ -889,7 +889,9 @@ sub create_config_line { ...@@ -889,7 +889,9 @@ sub create_config_line {
my $txt = $data->{value} ? 'yes' : 'no'; my $txt = $data->{value} ? 'yes' : 'no';
$text .= uc($key) . "=\"$txt\"\n"; $text .= uc($key) . "=\"$txt\"\n";
} else { } else {
$text .= uc($key) . "=\"$data->{value}\"\n"; my $value = $data->{value};
die "detected invalid newline inside property '$key'\n" if $value =~ m/\n/;
$text .= uc($key) . "=\"$value\"\n";
} }
} elsif (defined($data->{bar})) { } elsif (defined($data->{bar})) {
my $tmp = format_res_bar_lim($key, $data); my $tmp = format_res_bar_lim($key, $data);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment