diff options
author | James Wah <[email protected]> | 2021-03-04 03:28:49 +1100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-03-03 08:28:49 -0800 |
commit | 92fb29b9f95522d1083f4467e9aab9f8f1e7d0ba (patch) | |
tree | 907cdfde91ff919b245a0a3d5f2495d5456ac294 /lib | |
parent | e439ee83c1316b58d480148c9c851f42c1458305 (diff) |
Don't bomb out when using keylocation=file://
Avoid following the error path when the operation in fact succeeded.
Reviewed-by: Ryan Moeller <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: James Wah <[email protected]>
Closes #11651
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libzfs/libzfs_crypto.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/libzfs/libzfs_crypto.c b/lib/libzfs/libzfs_crypto.c index 1a2ee638a..fe3a0f283 100644 --- a/lib/libzfs/libzfs_crypto.c +++ b/lib/libzfs/libzfs_crypto.c @@ -532,6 +532,8 @@ get_key_material(libzfs_handle_t *hdl, boolean_t do_verify, boolean_t newkey, break; case ZFS_KEYLOCATION_URI: + ret = ENOTSUP; + for (handler = uri_handlers; handler->zuh_scheme != NULL; handler++) { 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, break; } - ret = ENOTSUP; - zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "URI scheme is not supported")); + if (ret == ENOTSUP) { + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "URI scheme is not supported")); + goto error; + } break; default: |