Skip to content

Commit 6ea9732

Browse files
author
James Wah
committed
Don't bomb out when using keylocation=file://
Avoid following the error path when the operation in fact succeeded. Signed-off-by: James Wah <[email protected]>
1 parent 778fa36 commit 6ea9732

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/libzfs/libzfs_crypto.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,8 @@ get_key_material(libzfs_handle_t *hdl, boolean_t do_verify, boolean_t newkey,
532532

533533
break;
534534
case ZFS_KEYLOCATION_URI:
535+
ret = ENOTSUP;
536+
535537
for (handler = uri_handlers; handler->zuh_scheme != NULL;
536538
handler++) {
537539
if (strcmp(handler->zuh_scheme, uri_scheme) != 0)
@@ -544,9 +546,11 @@ get_key_material(libzfs_handle_t *hdl, boolean_t do_verify, boolean_t newkey,
544546
break;
545547
}
546548

547-
ret = ENOTSUP;
548-
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
549-
"URI scheme is not supported"));
549+
if (ret == ENOTSUP) {
550+
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
551+
"URI scheme is not supported"));
552+
goto error;
553+
}
550554

551555
break;
552556
default:

0 commit comments

Comments
 (0)