summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-05-29 18:49:14 +0200
committerVolker Lendecke <vl@samba.org>2011-05-29 21:10:26 +0200
commitef0260ddbcb88361f805a1e08d42fdc589ebdcdd (patch)
tree83a390d8cb25d6d589dacc6e1ecc40a04df7c003
parent97dcdcd5c2b7d30a246a7faff89c6618cc083a94 (diff)
downloadsamba-ef0260ddbcb88361f805a1e08d42fdc589ebdcdd.tar.gz
samba-ef0260ddbcb88361f805a1e08d42fdc589ebdcdd.tar.bz2
samba-ef0260ddbcb88361f805a1e08d42fdc589ebdcdd.zip
s3: Fix cli_bad_session_request
We expect a negative session response with a 0x82 error (called name not present), not a 0x82 message
-rw-r--r--source3/torture/torture.c21
1 files 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;
}