From 66a93b1e7e1b6dc65910dfa613554e7289237f16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Mon, 14 Feb 2022 14:29:27 +0100 Subject: [PATCH] libzfs: sendrecv: fix missing error output for invalid properties MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: 7633c0aedd20f48646409b16b0e4524da24f7f9a ("libzfs: sendrecv: fix unused, remove argsused") Reviewed-by: Brian Behlendorf Reviewed-by: George Amanakis Reviewed-by: Ryan Moeller Signed-off-by: Ahelenia ZiemiaƄska Closes #13100 Closes #13101 --- lib/libzfs/libzfs_sendrecv.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/libzfs/libzfs_sendrecv.c b/lib/libzfs/libzfs_sendrecv.c index ab5b2b38188d..270190bf1bcc 100644 --- a/lib/libzfs/libzfs_sendrecv.c +++ b/lib/libzfs/libzfs_sendrecv.c @@ -5023,11 +5023,10 @@ static boolean_t zfs_receive_checkprops(libzfs_handle_t *hdl, nvlist_t *props, const char *errbuf) { - nvpair_t *nvp; + nvpair_t *nvp = NULL; zfs_prop_t prop; const char *name; - nvp = NULL; while ((nvp = nvlist_next_nvpair(props, nvp)) != NULL) { name = nvpair_name(nvp); prop = zfs_name_to_prop(name); @@ -5086,7 +5085,7 @@ zfs_receive_impl(libzfs_handle_t *hdl, const char *tosnap, /* check cmdline props, raise an error if they cannot be received */ if (!zfs_receive_checkprops(hdl, cmdprops, errbuf)) - return (-1); + return (zfs_error(hdl, EZFS_BADPROP, errbuf)); if (flags->isprefix && !zfs_dataset_exists(hdl, tosnap, ZFS_TYPE_DATASET)) {