From a8f356a71f20152a42962d54d52893084767ad2c Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 3 Jan 2002 07:36:26 +0000 Subject: A few changes to always output the erorr mapping even when the error was 'squashed' or the session setup succeeded. (How the latter occurs I don't know). (This used to be commit d879d2ffffc47ce161afb3d96bc5c4b92de662c3) --- source3/torture/torture.c | 61 ++++++++++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 27 deletions(-) (limited to 'source3/torture/torture.c') diff --git a/source3/torture/torture.c b/source3/torture/torture.c index 256fb891b3..dcae941424 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -2913,44 +2913,51 @@ static BOOL run_error_map_extract(int dummy) { for (error=(0xc0000000 | 0x1); error < (0xc0000000| 0xFFF); error++) { snprintf(user, sizeof(user), "%X", error); - if (!cli_session_setup(&c_nt, user, + if (cli_session_setup(&c_nt, user, password, strlen(password), password, strlen(password), - workgroup)) { - flgs2 = SVAL(c_nt.inbuf,smb_flg2); - - /* Case #1: 32-bit NT errors */ - if (flgs2 & FLAGS2_32_BIT_ERROR_CODES) { - nt_status = NT_STATUS(IVAL(c_nt.inbuf,smb_rcls)); - } else { - printf("** Dos error on NT connection! (%s)\n", cli_errstr(&c_nt)); - nt_status = NT_STATUS(0xc0000000); - } + workgroup)) { + printf("/** Session setup succeeded. This shouldn't happen...*/\n"); + } + + flgs2 = SVAL(c_nt.inbuf,smb_flg2); + + /* Case #1: 32-bit NT errors */ + if (flgs2 & FLAGS2_32_BIT_ERROR_CODES) { + nt_status = NT_STATUS(IVAL(c_nt.inbuf,smb_rcls)); } else { - printf("** Session setup succeeded. This shouldn't happen...\n"); + printf("** Dos error on NT connection! (%s)\n", + cli_errstr(&c_nt)); + nt_status = NT_STATUS(0xc0000000); } - if (!cli_session_setup(&c_dos, user, + if (cli_session_setup(&c_dos, user, password, strlen(password), password, strlen(password), workgroup)) { - flgs2 = SVAL(c_dos.inbuf,smb_flg2), errnum; - - /* Case #1: 32-bit NT errors */ - if (flgs2 & FLAGS2_32_BIT_ERROR_CODES) { - printf("** NT error on DOS connection! (%s)\n", cli_errstr(&c_nt)); - errnum = errclass = 0; - } else { - cli_dos_error(&c_dos, &errclass, &errnum); - } - } else { - printf("** Session setup succeeded. This shouldn't happen...\n"); + printf("/** Session setup succeeded. This shouldn't happen...*/\n"); } - if (NT_STATUS_V(nt_status) == error) { - printf("\t{%s,\t%s,\t%s},\n", smb_dos_err_class(errclass), smb_dos_err_name(errclass, errnum), get_nt_error_c_code(nt_status)); + flgs2 = SVAL(c_dos.inbuf,smb_flg2), errnum; + + /* Case #1: 32-bit NT errors */ + if (flgs2 & FLAGS2_32_BIT_ERROR_CODES) { + printf("** NT error on DOS connection! (%s)\n", + cli_errstr(&c_nt)); + errnum = errclass = 0; } else { - printf("/*\t{ This NT error code was 'sqashed'\n\t from %s to %s \n\t during the session setup }\n*/\n", get_nt_error_c_code(NT_STATUS(error)), get_nt_error_c_code(nt_status)); + cli_dos_error(&c_dos, &errclass, &errnum); } + + if (NT_STATUS_V(nt_status) != error) { + printf("/*\t{ This NT error code was 'sqashed'\n\t from %s to %s \n\t during the session setup }\n*/\n", + get_nt_error_c_code(NT_STATUS(error)), + get_nt_error_c_code(nt_status)); + } + + printf("\t{%s,\t%s,\t%s},\n", + smb_dos_err_class(errclass), + smb_dos_err_name(errclass, errnum), + get_nt_error_c_code(nt_status)); } return True; } -- cgit