From 4e8003721b9735a190927cd802d216a51d73326b Mon Sep 17 00:00:00 2001 From: "n.bouteillier" Date: Wed, 26 Oct 2016 16:34:12 +0200 Subject: [PATCH] Fix issue with double \ on old systemd. - use base64 for >229 :disappointed: --- work/unit-generate.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/work/unit-generate.go b/work/unit-generate.go index a01928b..ebf09a5 100644 --- a/work/unit-generate.go +++ b/work/unit-generate.go @@ -39,8 +39,8 @@ func (u *Unit) Generate(tmpl *template.Templating) error { if err != nil { logs.WithEF(err, u.Fields).Panic("Cannot marshall attributes") } - res := strings.Replace(string(out), "\\\"", `\x5c\x22`, -1) - res = strings.Replace(res, "'", `\\'`, -1) + res := strings.Replace(string(out), "\\\"", "\\\\\\\"", -1) + res = strings.Replace(res, "'", `\'`, -1) data["attributes"] = res data["attributesBase64"] = "base64," + base64.StdEncoding.EncodeToString([]byte(out))