From 37086897b06a070d957226dbf860b4673906dc70 Mon Sep 17 00:00:00 2001 From: наб Date: Thu, 13 May 2021 06:21:35 +0200 Subject: libzfs: add keylocation=https://, backed by fetch(3) or libcurl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add support for http and https to the keylocation properly to allow encryption keys to be fetched from the specified URL. Reviewed-by: Brian Behlendorf Reviewed-by: Ryan Moeller Signed-off-by: Ahelenia Ziemiańska Issue #9543 Closes #9947 Closes #11956 --- lib/libzfs/libzfs_util.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/libzfs/libzfs_util.c') diff --git a/lib/libzfs/libzfs_util.c b/lib/libzfs/libzfs_util.c index 7840e3590..fdb574651 100644 --- a/lib/libzfs/libzfs_util.c +++ b/lib/libzfs/libzfs_util.c @@ -44,6 +44,9 @@ #include #include #include +#if LIBFETCH_DYNAMIC +#include +#endif #include #include #include @@ -1083,6 +1086,11 @@ libzfs_fini(libzfs_handle_t *hdl) libzfs_core_fini(); regfree(&hdl->libzfs_urire); fletcher_4_fini(); +#if LIBFETCH_DYNAMIC + if (hdl->libfetch != (void *)-1 && hdl->libfetch != NULL) + (void) dlclose(hdl->libfetch); + free(hdl->libfetch_load_error); +#endif free(hdl); } -- cgit v1.2.3