Skip to content

Commit

Permalink
libzfs: sendrecv: fix missing error output for invalid properties
Browse files Browse the repository at this point in the history
Fixes: 7633c0a ("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
  • Loading branch information
nabijaczleweli authored and behlendorf committed Feb 14, 2022
1 parent 0c8aab9 commit ae07fc1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/libzfs/libzfs_sendrecv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)) {
Expand Down

0 comments on commit ae07fc1

Please sign in to comment.