From 23184b172a8bed1c248c8aef3b7e02d5515c88f5 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 5fb93d2659..e31d4ce44b 100644 --- a/lib/libzfs/libzfs_crypto.c +++ b/lib/libzfs/libzfs_crypto.c @@ -472,7 +472,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); }