aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libzfs
diff options
context:
space:
mode:
authorнаб <[email protected]>2022-02-14 14:29:27 +0100
committerBrian Behlendorf <[email protected]>2022-02-14 13:07:56 -0800
commitae07fc1393062507b62d9d475e57393be590e432 (patch)
tree7c96a620c07e8293236bdb3939d8f8c3e3dad65c /lib/libzfs
parent0c8aab9586246e69b08d65500eb71270e2432762 (diff)
libzfs: sendrecv: fix missing error output for invalid properties
Fixes: 7633c0aedd20f48646409b16b0e4524da24f7f9a ("libzfs: sendrecv: fix unused, remove argsused") Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: George Amanakis <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #13100 Closes #13101
Diffstat (limited to 'lib/libzfs')
-rw-r--r--lib/libzfs/libzfs_sendrecv.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/libzfs/libzfs_sendrecv.c b/lib/libzfs/libzfs_sendrecv.c
index ab5b2b381..270190bf1 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)) {