From f3678d70ff8f98d67caf377ec0326c9a6c7bcf29 Mon Sep 17 00:00:00 2001 From: Rich Ercolani <214141+rincebrain@users.noreply.github.com> Date: Thu, 5 Aug 2021 19:48:33 -0400 Subject: [PATCH] Make get_key_material_file fail more verbosely It turns out, there are a lot of possible reasons for fopen to fail. Let's share which reason we failed for today. Reviewed-by: Brian Behlendorf Reviewed-by: Tony Nguyen Signed-off-by: Rich Ercolani Closes #12410 --- lib/libzfs/libzfs_crypto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libzfs/libzfs_crypto.c b/lib/libzfs/libzfs_crypto.c index c3cded24f..644dd2685 100644 --- a/lib/libzfs/libzfs_crypto.c +++ b/lib/libzfs/libzfs_crypto.c @@ -486,7 +486,7 @@ get_key_material_file(libzfs_handle_t *hdl, const char *uri, ret = errno; errno = 0; zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "Failed to open key material file")); + "Failed to open key material file: %s"), strerror(ret)); return (ret); }