all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Fabian Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager 1/1] vzdump: check that notes-template is a single line
Date: Thu, 28 Apr 2022 10:07:39 +0200	[thread overview]
Message-ID: <20220428080741.55308-1-f.ebner@proxmox.com> (raw)

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>
---

These are follow-ups for the "add protected and notes-template
parameters for vzdump" series.

 PVE/VZDump.pm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm
index fcbd87d5..80cbddb5 100644
--- a/PVE/VZDump.pm
+++ b/PVE/VZDump.pm
@@ -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;
-- 
2.30.2





             reply	other threads:[~2022-04-28  8:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-28  8:07 Fabian Ebner [this message]
2022-04-28  8:07 ` [pve-devel] [PATCH guest-common 1/1] vzdump: update notes-template description Fabian Ebner
2022-04-28  8:07 ` [pve-devel] [PATCH docs 1/1] vzdump: add section for notes and notes-template Fabian Ebner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220428080741.55308-1-f.ebner@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal