]> git.proxmox.com Git - pve-manager-legacy.git/commitdiff
vzdump: check that notes-template is a single line
authorFabian Ebner <f.ebner@proxmox.com>
Thu, 28 Apr 2022 08:07:39 +0000 (10:07 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 28 Apr 2022 12:16:33 +0000 (14:16 +0200)
While vzdump itself wouldn't mind about unescaped newlines, the
parameter isn't supposed to contain any, and when used as part of the
job config, it has to be a single line too, so make it consistent.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
PVE/VZDump.pm

index fcbd87d5a63f5b2c3c5f89118928b93df9329570..80cbddb53107c3d5cd125b30c6a6b586246f99c2 100644 (file)
@@ -1326,6 +1326,9 @@ sub verify_vzdump_parameters {
 
     $parse_prune_backups_maxfiles->($param, 'CLI parameters');
 
+    raise_param_exc({'notes-template' => "contains a line feed"})
+       if $param->{'notes-template'} && $param->{'notes-template'} =~ m/\n/;
+
     $param->{all} = 1 if (defined($param->{exclude}) && !$param->{pool});
 
     return if !$check_missing;