From ad6bcc9e00808b7848fd2caca47525a191b24ff1 Mon Sep 17 00:00:00 2001 From: Max Carrara Date: Tue, 2 Apr 2024 16:55:19 +0200 Subject: [PATCH] cephconfig: escape un-escaped comment literals on write in order to prevent configuration errors or the configuration being misinterpreted. Signed-off-by: Max Carrara Tested-by: Friedrich Weber --- src/PVE/CephConfig.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/PVE/CephConfig.pm b/src/PVE/CephConfig.pm index 845b7d2..0def1f2 100644 --- a/src/PVE/CephConfig.pm +++ b/src/PVE/CephConfig.pm @@ -105,6 +105,9 @@ sub write_ceph_config { $cond_write_sec->($re); } + # Escape comment literals that aren't escaped already + $out =~ s/(?