libzfs: ensure all ioctl calls go through lzc_ioctl_fd()

Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Closes #17344
This commit is contained in:
Rob Norris 2025-05-16 21:43:38 +10:00 committed by Brian Behlendorf
parent 2e5e4bb0f8
commit f454cc1723
4 changed files with 7 additions and 13 deletions

View File

@ -4911,7 +4911,7 @@ zfs_smb_acl_mgmt(libzfs_handle_t *hdl, char *dataset, char *path,
default:
return (-1);
}
error = ioctl(hdl->libzfs_fd, ZFS_IOC_SMB_ACL, &zc);
error = lzc_ioctl_fd(hdl->libzfs_fd, ZFS_IOC_SMB_ACL, &zc);
nvlist_free(nvlist);
return (error);
}

View File

@ -785,6 +785,12 @@ zpool_standard_error_fmt(libzfs_handle_t *hdl, int error, const char *fmt, ...)
return (-1);
}
int
zfs_ioctl(libzfs_handle_t *hdl, int request, zfs_cmd_t *zc)
{
return (lzc_ioctl_fd(hdl->libzfs_fd, request, zc));
}
/*
* Display an out of memory error message and abort the current program.
*/

View File

@ -218,12 +218,6 @@ libzfs_error_init(int error)
return (errbuf);
}
int
zfs_ioctl(libzfs_handle_t *hdl, int request, zfs_cmd_t *zc)
{
return (lzc_ioctl_fd(hdl->libzfs_fd, request, zc));
}
/*
* Verify the required ZFS_DEV device is available and optionally attempt
* to load the ZFS modules. Under normal circumstances the modules

View File

@ -53,12 +53,6 @@
#define ZDIFF_SHARESDIR "/.zfs/shares/"
int
zfs_ioctl(libzfs_handle_t *hdl, int request, zfs_cmd_t *zc)
{
return (ioctl(hdl->libzfs_fd, request, zc));
}
const char *
libzfs_error_init(int error)
{