cephconfig: escape un-escaped comment literals on write

in order to prevent configuration errors or the configuration being
misinterpreted.

Signed-off-by: Max Carrara <m.carrara@proxmox.com>
Tested-by: Friedrich Weber <f.weber@proxmox.com>
This commit is contained in:
Max Carrara
2024-04-02 16:55:19 +02:00
committed by Fabian Grünbichler
parent d93f8aea9d
commit ad6bcc9e00

View File

@ -105,6 +105,9 @@ sub write_ceph_config {
$cond_write_sec->($re);
}
# Escape comment literals that aren't escaped already
$out =~ s/(?<!\\)([;#])/\\$1/gm;
return $out;
}