summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-03-30 09:45:44 +0000
committerAndrew Tridgell <tridge@samba.org>2003-03-30 09:45:44 +0000
commitcb830f05ae4ab5057209fb1b7c68bae450e78b22 (patch)
tree92d0431fdc0feb39995776e52c136b1b02ebdf18 /source3/libsmb
parentbcd9a08802f9f4f4b68741fb51574d3944cb4040 (diff)
downloadsamba-cb830f05ae4ab5057209fb1b7c68bae450e78b22.tar.gz
samba-cb830f05ae4ab5057209fb1b7c68bae450e78b22.tar.bz2
samba-cb830f05ae4ab5057209fb1b7c68bae450e78b22.zip
added simple tests for SMBchkpath and SMBioctl
(This used to be commit ca982a9f1d6485e2d388d4b2e9c13806736ad91e)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clifile.c32
1 files changed, 31 insertions, 1 deletions
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;
+}