Skip to content

Commit 13768f4

Browse files
robntonyhutter
authored andcommitted
libzfs: ensure all ioctl calls go through lzc_ioctl_fd()
Sponsored-by: https://despairlabs.com/sponsor/ Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Signed-off-by: Rob Norris <[email protected]> Closes #17344 (cherry picked from commit f454cc1)
1 parent 999717c commit 13768f4

File tree

4 files changed

+7
-13
lines changed

4 files changed

+7
-13
lines changed

lib/libzfs/libzfs_dataset.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4905,7 +4905,7 @@ zfs_smb_acl_mgmt(libzfs_handle_t *hdl, char *dataset, char *path,
49054905
default:
49064906
return (-1);
49074907
}
4908-
error = ioctl(hdl->libzfs_fd, ZFS_IOC_SMB_ACL, &zc);
4908+
error = lzc_ioctl_fd(hdl->libzfs_fd, ZFS_IOC_SMB_ACL, &zc);
49094909
nvlist_free(nvlist);
49104910
return (error);
49114911
}

lib/libzfs/libzfs_util.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -785,6 +785,12 @@ zpool_standard_error_fmt(libzfs_handle_t *hdl, int error, const char *fmt, ...)
785785
return (-1);
786786
}
787787

788+
int
789+
zfs_ioctl(libzfs_handle_t *hdl, int request, zfs_cmd_t *zc)
790+
{
791+
return (lzc_ioctl_fd(hdl->libzfs_fd, request, zc));
792+
}
793+
788794
/*
789795
* Display an out of memory error message and abort the current program.
790796
*/

lib/libzfs/os/freebsd/libzfs_compat.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -218,12 +218,6 @@ libzfs_error_init(int error)
218218
return (errbuf);
219219
}
220220

221-
int
222-
zfs_ioctl(libzfs_handle_t *hdl, int request, zfs_cmd_t *zc)
223-
{
224-
return (lzc_ioctl_fd(hdl->libzfs_fd, request, zc));
225-
}
226-
227221
/*
228222
* Verify the required ZFS_DEV device is available and optionally attempt
229223
* to load the ZFS modules. Under normal circumstances the modules

lib/libzfs/os/linux/libzfs_util_os.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,6 @@
5353

5454
#define ZDIFF_SHARESDIR "/.zfs/shares/"
5555

56-
int
57-
zfs_ioctl(libzfs_handle_t *hdl, int request, zfs_cmd_t *zc)
58-
{
59-
return (ioctl(hdl->libzfs_fd, request, zc));
60-
}
61-
6256
const char *
6357
libzfs_error_init(int error)
6458
{

0 commit comments

Comments
 (0)