From ef0260ddbcb88361f805a1e08d42fdc589ebdcdd Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 29 May 2011 18:49:14 +0200 Subject: s3: Fix cli_bad_session_request We expect a negative session response with a 0x82 error (called name not present), not a 0x82 message --- source3/torture/torture.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/source3/torture/torture.c b/source3/torture/torture.c index 36c300b360..47f4efd5d8 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -211,6 +211,8 @@ static bool cli_bad_session_request(int fd, uint8_t *inbuf; int err; bool ret = false; + uint8_t message_type; + uint8_t error; frame = talloc_stackframe(); @@ -262,8 +264,23 @@ static bool cli_bad_session_request(int fd, goto fail; } - if (CVAL(inbuf,0) != 0x82) { - /* This is the wrong place to put the error... JRA. */ + message_type = CVAL(inbuf, 0); + if (message_type != 0x83) { + d_fprintf(stderr, "Expected msg type 0x83, got 0x%2.2x\n", + message_type); + goto fail; + } + + if (smb_len(inbuf) != 1) { + d_fprintf(stderr, "Expected smb_len 1, got %d\n", + (int)smb_len(inbuf)); + goto fail; + } + + error = CVAL(inbuf, 4); + if (error != 0x82) { + d_fprintf(stderr, "Expected error 0x82, got %d\n", + (int)error); goto fail; } -- cgit