mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 03:37:45 +03:00
Skip loading already loaded key
Don't ask for the password / try to load the key if the key for the encryptionroot is already loaded. The user might have loaded the key manually or by other means before the scripts get called. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Tom Caputi <tcaputi@datto.com> Reviewed-by: Richard Laager <rlaager@wiktel.com> Signed-off-by: Witaut Bajaryn <vitaut.bayaryn@gmail.com> Closes #9495 Closes #9529
This commit is contained in:
committed by
Tony Hutter
parent
1253fcc70a
commit
618206c0b9
@@ -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\" = \"unavailable\" ] || exit 0;"\
|
||||
"count=0;"\
|
||||
"while [ \$\$count -lt 3 ];do"\
|
||||
" systemd-ask-password --id=\"zfs:${dataset}\""\
|
||||
|
||||
Reference in New Issue
Block a user