File tree Expand file tree Collapse file tree 3 files changed +22
-8
lines changed
Expand file tree Collapse file tree 3 files changed +22
-8
lines changed Original file line number Diff line number Diff line change 9191 updateOptions = builtins . removeAttrs createOptions onetimeProperties ;
9292 in
9393 ''
94- if ! zfs get type ${ config . _name } >/dev/null 2>&1; then
94+ if ! zfs get type " ${ config . _name } " >/dev/null 2>&1; then
9595 ${
9696 if config . _createFilesystem then
9797 ''
98- zfs create -up ${ config . _name } \
99- ${ lib . concatStringsSep " " ( lib . mapAttrsToList ( n : v : "-o ${ n } =${ v } " ) ( createOptions ) ) }
98+ zfs create -up "${ config . _name } " \
99+ ${ lib . concatStringsSep " " (
100+ lib . mapAttrsToList ( n : v : "-o ${ n } =${ lib . escapeShellArg v } " ) ( createOptions )
101+ ) }
100102 ''
101103 else
102104 ''
107109 ${ lib . optionalString ( updateOptions != { } ) ''
108110 else
109111 zfs set -u ${
110- lib . concatStringsSep " " ( lib . mapAttrsToList ( n : v : "${ n } =${ v } " ) updateOptions )
111- } ${ config . _name }
112+ lib . concatStringsSep " " ( lib . mapAttrsToList ( n : v : "${ n } =${ lib . escapeShellArg v } " ) updateOptions )
113+ } " ${ config . _name } "
112114 '' }
113115 fi
114116 '' ;
Original file line number Diff line number Diff line change 6363 default = ''
6464 if ! zfs get type "${ config . _parent . name } /${ config . name } " >/dev/null 2>&1; then
6565 zfs create "${ config . _parent . name } /${ config . name } " \
66- ${ lib . concatStringsSep " " ( lib . mapAttrsToList ( n : v : "-o ${ n } =${ v } " ) config . options ) } \
66+ ${
67+ lib . concatStringsSep " " (
68+ lib . mapAttrsToList ( n : v : "-o ${ n } =${ lib . escapeShellArg v } " ) config . options
69+ )
70+ } \
6771 -V ${ config . size } ${ toString ( builtins . map lib . escapeShellArg config . extraArgs ) }
6872 zvol_wait
6973 partprobe "/dev/zvol/${ config . _parent . name } /${ config . name } "
Original file line number Diff line number Diff line change 377377 else
378378 ""
379379 } \
380- ${ lib . concatStringsSep " " ( lib . mapAttrsToList ( n : v : "-o ${ n } =${ v } " ) config . options ) } \
381- ${ lib . concatStringsSep " " ( lib . mapAttrsToList ( n : v : "-O ${ n } =${ v } " ) config . rootFsOptions ) } \
380+ ${
381+ lib . concatStringsSep " " (
382+ lib . mapAttrsToList ( n : v : "-o ${ n } =${ lib . escapeShellArg v } " ) config . options
383+ )
384+ } \
385+ ${
386+ lib . concatStringsSep " " (
387+ lib . mapAttrsToList ( n : v : "-O ${ n } =${ lib . escapeShellArg v } " ) config . rootFsOptions
388+ )
389+ } \
382390 '' ${topology:+ $topology}
383391 if [[ $(zfs get -H mounted "${ config . name } " | cut -f3) == "yes" ]]; then
384392 zfs unmount "${ config . name } "
You can’t perform that action at this time.
0 commit comments