From e6f96b6aa3e99495f9f6f3488ecf78dd316e5bec Mon Sep 17 00:00:00 2001 From: Symphorien Gibol Date: Thu, 17 Sep 2020 12:00:00 +0000 Subject: [PATCH] unison: fix escaping of arguments The `ExecStart=` option of systemd must take arguments fully quoted. That is, "-sshargs=-i somekey" and not -ssargs="-i somekey" Additionally, inside arguments passed to unison, `=` characters must be quoted. After unquotation by systemd, one must have -sshargs=-o Foo\=4 instead of -sshargs=-o Foo=4 (cherry picked from commit 92c682cd1005652699382029ca616aec888cd394) Fixes #1500 --- modules/services/unison.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/services/unison.nix b/modules/services/unison.nix index 93c59e8fd..a9cf23fb6 100644 --- a/modules/services/unison.nix +++ b/modules/services/unison.nix @@ -60,7 +60,7 @@ let }; }; - serialiseArg = key: val: "-${key}=${escapeShellArg val}"; + serialiseArg = key: val: escapeShellArg "-${key}=${escape [ "=" ] val}"; serialiseArgs = args: concatStringsSep " " (mapAttrsToList serialiseArg args);