all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH v2 manager 1/3] vzdump: notes-template: avoid escaping meta-characters upon replace
@ 2022-05-03 11:17 Fabian Ebner
  2022-05-03 11:17 ` [pve-devel] [PATCH v2 manager 2/3] vzdump: notes-template: improve check for unknown variable Fabian Ebner
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Fabian Ebner @ 2022-05-03 11:17 UTC (permalink / raw)
  To: pve-devel

which is caused by the quoting operators \Q...\E. The actual intention
was to avoid such surprises.

Fixes: 413bb432 ("partially close #438: vzdump: support setting notes-template")
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---

Changes from v1:
    * Add follow-ups to further improve behavior.

 PVE/VZDump.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm
index 22fdb324..9af2de3d 100644
--- a/PVE/VZDump.pm
+++ b/PVE/VZDump.pm
@@ -90,7 +90,7 @@ my $generate_notes = sub {
     $notes_template =~ s/\\(.)/$unescape->($1)/eg;
 
     my $vars = join('|', keys $info->%*);
-    $notes_template =~ s/\{\{($vars)\}\}/\Q$info->{$1}\E/g;
+    $notes_template =~ s/\{\{($vars)\}\}/$info->{$1}/g;
 
     die "unexpected variable name '$1'" if $notes_template =~ m/\{\{([^\s]+)\}\}/;
 
-- 
2.30.2





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-05-04  6:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-03 11:17 [pve-devel] [PATCH v2 manager 1/3] vzdump: notes-template: avoid escaping meta-characters upon replace Fabian Ebner
2022-05-03 11:17 ` [pve-devel] [PATCH v2 manager 2/3] vzdump: notes-template: improve check for unknown variable Fabian Ebner
2022-05-04  6:21   ` [pve-devel] applied: " Thomas Lamprecht
2022-05-03 11:18 ` [pve-devel] [PATCH/RFC v2 manager 3/3] vzdump: notes-template: replace unknown variable with error string Fabian Ebner
2022-05-04  6:23   ` Thomas Lamprecht
2022-05-04  6:20 ` [pve-devel] applied: [PATCH v2 manager 1/3] vzdump: notes-template: avoid escaping meta-characters upon replace Thomas Lamprecht

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