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 <behlendorf1@llnl.gov>
Reviewed-by: George Amanakis <gamanakis@gmail.com>
Reviewed-by: Ryan Moeller <freqlabs@FreeBSD.org>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
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.