Skip to content

Commit

Permalink
zfs-mount-generator: Skip loading already loaded key
Browse files Browse the repository at this point in the history
Don't ask for the password / try to load the key
if the key for the encryptionroot is already loaded.

Closes openzfs#9495

Signed-off-by: Witaut Bajaryn <[email protected]>
  • Loading branch information
vozhyk- committed Oct 29, 2019
1 parent d46f0de commit 97e9942
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions etc/systemd/system-generators/zfs-mount-generator.in
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ process_line() {
keyloadcmd="@sbindir@/zfs load-key '${dataset}'"
elif [ "${p_keyloc}" = "prompt" ] ; then
keyloadcmd="sh -c 'set -eu;"\
"keystatus=\"\$\$(@sbindir@/zfs get -H -o value keystatus \"${dataset}\")\";"\
"[ \"\$\$keystatus\" = \"available\" ] && exit 0;"\
"count=0;"\
"while [ \$\$count -lt 3 ];do"\
" systemd-ask-password --id=\"zfs:${dataset}\""\
Expand Down

0 comments on commit 97e9942

Please sign in to comment.