summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-05-29 18:17:18 +0200
committerVolker Lendecke <vl@samba.org>2011-05-29 21:10:26 +0200
commit18a54fe4eb8f78a3661dbc5c357a6f021f09e79e (patch)
tree088e59134e32e183e5a1fe5155e9a1d9e77348df /source3
parentdebaf40e99c6d82c03f00ba10e43ab4bb81d8e41 (diff)
downloadsamba-18a54fe4eb8f78a3661dbc5c357a6f021f09e79e.tar.gz
samba-18a54fe4eb8f78a3661dbc5c357a6f021f09e79e.tar.bz2
samba-18a54fe4eb8f78a3661dbc5c357a6f021f09e79e.zip
s3: Simplify cli_bad_session_request
For this purpose we don't need the full cli_state
Diffstat (limited to 'source3')
-rw-r--r--source3/torture/torture.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index ae34077cbe..6afa94b3b2 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -201,7 +201,7 @@ static struct cli_state *open_nbt_connection(void)
Send a corrupt session request. See rfc1002.txt 4.3 and 4.3.2.
****************************************************************************/
-static bool cli_bad_session_request(struct cli_state *cli,
+static bool cli_bad_session_request(int fd,
struct nmb_name *calling, struct nmb_name *called)
{
TALLOC_CTX *frame;
@@ -212,13 +212,6 @@ static bool cli_bad_session_request(struct cli_state *cli,
int err;
bool ret = false;
- memcpy(&(cli->calling), calling, sizeof(*calling));
- memcpy(&(cli->called ), called , sizeof(*called ));
-
- /* 445 doesn't have session request */
- if (cli->port == 445)
- return True;
-
frame = talloc_stackframe();
iov[0].iov_base = len_buf;
@@ -259,11 +252,11 @@ static bool cli_bad_session_request(struct cli_state *cli,
_smb_setlen(len_buf, iov[1].iov_len + iov[2].iov_len);
SCVAL(len_buf,0,0x81);
- len = write_data_iov(cli->fd, iov, 3);
+ len = write_data_iov(fd, iov, 3);
if (len == -1) {
goto fail;
}
- len = read_smb(cli->fd, talloc_tos(), &inbuf, &err);
+ len = read_smb(fd, talloc_tos(), &inbuf, &err);
if (len == -1) {
errno = err;
goto fail;
@@ -271,7 +264,6 @@ static bool cli_bad_session_request(struct cli_state *cli,
if (CVAL(inbuf,0) != 0x82) {
/* This is the wrong place to put the error... JRA. */
- cli->rap_error = CVAL(inbuf,4);
goto fail;
}
@@ -308,7 +300,7 @@ static struct cli_state *open_bad_nbt_connection(void)
c->timeout = 4000; /* set a short timeout (4 seconds) */
- if (!cli_bad_session_request(c, &calling, &called)) {
+ if (!cli_bad_session_request(c->fd, &calling, &called)) {
printf("Failed to connect with %s. Error %s\n", host, nt_errstr(status) );
return NULL;
}