From: Volker Lendecke Date: Wed, 16 Aug 2023 09:04:14 +0000 (+0200) Subject: libsmb: Move cli_raw_ioctl() to torture3 X-Git-Tag: tevent-0.16.0~857 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a6a5ce7b4261480ef79da965b43fcb5caa604e3d;p=thirdparty%2Fsamba.git libsmb: Move cli_raw_ioctl() to torture3 Only used there. Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c index 5f8f27e65f7..30c36e4c314 100644 --- a/source3/libsmb/clifile.c +++ b/source3/libsmb/clifile.c @@ -5458,27 +5458,6 @@ NTSTATUS cli_ctemp(struct cli_state *cli, return status; } -/* - send a raw ioctl - used by the torture code -*/ -NTSTATUS cli_raw_ioctl(struct cli_state *cli, uint16_t fnum, uint32_t code, DATA_BLOB *blob) -{ - uint16_t vwv[3]; - NTSTATUS status; - - SSVAL(vwv+0, 0, fnum); - SSVAL(vwv+1, 0, code>>16); - SSVAL(vwv+2, 0, (code&0xFFFF)); - - status = cli_smb(talloc_tos(), cli, SMBioctl, 0, 3, vwv, 0, NULL, - NULL, 0, NULL, NULL, NULL, NULL); - if (!NT_STATUS_IS_OK(status)) { - return status; - } - *blob = data_blob_null; - return NT_STATUS_OK; -} - /********************************************************* Set an extended attribute utility fn. *********************************************************/ diff --git a/source3/libsmb/proto.h b/source3/libsmb/proto.h index c461f2d39ba..1d17cc8cb76 100644 --- a/source3/libsmb/proto.h +++ b/source3/libsmb/proto.h @@ -596,7 +596,6 @@ NTSTATUS cli_ctemp(struct cli_state *cli, const char *path, uint16_t *pfnum, char **out_path); -NTSTATUS cli_raw_ioctl(struct cli_state *cli, uint16_t fnum, uint32_t code, DATA_BLOB *blob); NTSTATUS cli_set_ea_path(struct cli_state *cli, const char *path, const char *ea_name, const char *ea_val, size_t ea_len); diff --git a/source3/torture/torture.c b/source3/torture/torture.c index 62b27d7437b..bfce1c9dcd6 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -9900,6 +9900,42 @@ static NTSTATUS del_fn(struct file_info *finfo, const char *mask, } +/* + send a raw ioctl - used by the torture code +*/ +static NTSTATUS cli_raw_ioctl(struct cli_state *cli, + uint16_t fnum, + uint32_t code, + DATA_BLOB *blob) +{ + uint16_t vwv[3]; + NTSTATUS status; + + PUSH_LE_U16(vwv + 0, 0, fnum); + PUSH_LE_U16(vwv + 1, 0, code >> 16); + PUSH_LE_U16(vwv + 2, 0, (code & 0xFFFF)); + + status = cli_smb(talloc_tos(), + cli, + SMBioctl, + 0, + 3, + vwv, + 0, + NULL, + NULL, + 0, + NULL, + NULL, + NULL, + NULL); + if (!NT_STATUS_IS_OK(status)) { + return status; + } + *blob = data_blob_null; + return NT_STATUS_OK; +} + /* sees what IOCTLs are supported */