diff options
author | наб <[email protected]> | 2022-02-14 14:29:27 +0100 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2022-02-14 13:07:56 -0800 |
commit | ae07fc1393062507b62d9d475e57393be590e432 (patch) | |
tree | 7c96a620c07e8293236bdb3939d8f8c3e3dad65c /lib | |
parent | 0c8aab9586246e69b08d65500eb71270e2432762 (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')
-rw-r--r-- | lib/libzfs/libzfs_sendrecv.c | 5 |
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)) { |