From 2a341bd2f4c202781c118b46c6ecde75a2935e7e Mon Sep 17 00:00:00 2001 From: Klemens Nanni Date: Tue, 3 May 2022 15:39:50 +0200 Subject: [PATCH] nixos/filesystems/zfs: Escape dataset names Although unlikely, ZFS happily accepts names like 'zroot/foo -r'. Escape names and separate command line options from arguments to avoid any kind of misinterpretation. --- nixos/modules/tasks/filesystems/zfs.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/tasks/filesystems/zfs.nix b/nixos/modules/tasks/filesystems/zfs.nix index 5eca68798d5d..08f7fc1eba32 100644 --- a/nixos/modules/tasks/filesystems/zfs.nix +++ b/nixos/modules/tasks/filesystems/zfs.nix @@ -461,7 +461,7 @@ in zfs load-key -a '' else concatMapStrings (fs: '' - zfs load-key ${fs} + zfs load-key -- ${escapeShellArg fs} '') cfgZfs.requestEncryptionCredentials} '') rootPools)); };