From bc7fd7238a6596dfd0eb1d194f8ca73217d25e01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 20 Sep 2024 14:47:45 +0200 Subject: [PATCH] filesystem: escape shell args --- lib/types/filesystem.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/types/filesystem.nix b/lib/types/filesystem.nix index 8f9e80d..5327e7a 100644 --- a/lib/types/filesystem.nix +++ b/lib/types/filesystem.nix @@ -46,7 +46,7 @@ default = '' if ! (blkid '${config.device}' | grep -q 'TYPE='); then mkfs.${config.format} \ - ${toString config.extraArgs} \ + ${lib.escapeShellArgs config.extraArgs} \ ${config.device} fi ''; @@ -58,7 +58,7 @@ if ! findmnt ${config.device} "${rootMountPoint}${config.mountpoint}" >/dev/null 2>&1; then mount ${config.device} "${rootMountPoint}${config.mountpoint}" \ -t "${config.format}" \ - ${lib.concatMapStringsSep " " (opt: "-o ${opt}") config.mountOptions} \ + ${lib.concatMapStringsSep " " (opt: "-o ${lib.escapeShellArg opt}") config.mountOptions} \ -o X-mount.mkdir fi '';