From cb830f05ae4ab5057209fb1b7c68bae450e78b22 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 30 Mar 2003 09:45:44 +0000 Subject: added simple tests for SMBchkpath and SMBioctl (This used to be commit ca982a9f1d6485e2d388d4b2e9c13806736ad91e) --- source3/libsmb/clifile.c | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'source3/libsmb') diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c index d86f36405d..4eb5efe193 100644 --- a/source3/libsmb/clifile.c +++ b/source3/libsmb/clifile.c @@ -942,7 +942,6 @@ BOOL cli_setatr(struct cli_state *cli, const char *fname, uint16 attr, time_t t) /**************************************************************************** Check for existance of a dir. ****************************************************************************/ - BOOL cli_chkpath(struct cli_state *cli, const char *path) { pstring path2; @@ -1049,3 +1048,34 @@ int cli_ctemp(struct cli_state *cli, const char *path, char **tmp_path) return SVAL(cli->inbuf,smb_vwv0); } + + +/* + send a raw ioctl - used by the torture code +*/ +NTSTATUS cli_raw_ioctl(struct cli_state *cli, int fnum, uint32 code, DATA_BLOB *blob) +{ + memset(cli->outbuf,'\0',smb_size); + memset(cli->inbuf,'\0',smb_size); + + set_message(cli->outbuf, 3, 0, True); + SCVAL(cli->outbuf,smb_com,SMBioctl); + cli_setup_packet(cli); + + SSVAL(cli->outbuf, smb_vwv0, fnum); + SSVAL(cli->outbuf, smb_vwv1, code>>16); + SSVAL(cli->outbuf, smb_vwv2, (code&0xFFFF)); + + cli_send_smb(cli); + if (!cli_receive_smb(cli)) { + return NT_STATUS_UNEXPECTED_NETWORK_ERROR; + } + + if (cli_is_error(cli)) { + return cli_nt_error(cli); + } + + *blob = data_blob(NULL, 0); + + return NT_STATUS_OK; +} -- cgit