From 9c7491d3cfa6454aeaeb7600e22d22df2f01c7cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Schr=C3=B6ter?= Date: Fri, 3 Dec 2021 12:22:47 +0100 Subject: [PATCH] nixos/ddclient: support all special characters in password (cherry picked from commit f0bd0f3e4c2383c0ecb646835ef68f69675b4031) --- nixos/modules/services/networking/ddclient.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/networking/ddclient.nix b/nixos/modules/services/networking/ddclient.nix index fd9c216b0602..8a2c0fc7080c 100644 --- a/nixos/modules/services/networking/ddclient.nix +++ b/nixos/modules/services/networking/ddclient.nix @@ -31,8 +31,8 @@ let preStart = '' install ${configFile} /run/${RuntimeDirectory}/ddclient.conf ${lib.optionalString (cfg.configFile == null) (if (cfg.passwordFile != null) then '' - password=$(head -n 1 ${cfg.passwordFile}) - sed -i "s/^password=$/password=$password/" /run/${RuntimeDirectory}/ddclient.conf + password=$(printf "%q" "$(head -n 1 "${cfg.passwordFile}")") + sed -i "s|^password=$|password=$password|" /run/${RuntimeDirectory}/ddclient.conf '' else '' sed -i '/^password=$/d' /run/${RuntimeDirectory}/ddclient.conf '')}