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.
This commit is contained in:
Klemens Nanni 2022-05-03 15:39:50 +02:00
parent 83beeb19ac
commit 2a341bd2f4

View File

@ -461,7 +461,7 @@ in
zfs load-key -a
''
else concatMapStrings (fs: ''
zfs load-key ${fs}
zfs load-key -- ${escapeShellArg fs}
'') cfgZfs.requestEncryptionCredentials}
'') rootPools));
};