summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2002-01-03 07:36:26 +0000
committerAndrew Bartlett <abartlet@samba.org>2002-01-03 07:36:26 +0000
commita8f356a71f20152a42962d54d52893084767ad2c (patch)
tree866ef7ea8f848bb6f896a39bd70386d2090242f7 /source3
parent2998af3746b1e31bddbc3c1718ba482fa53c616b (diff)
downloadsamba-a8f356a71f20152a42962d54d52893084767ad2c.tar.gz
samba-a8f356a71f20152a42962d54d52893084767ad2c.tar.bz2
samba-a8f356a71f20152a42962d54d52893084767ad2c.zip
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)
Diffstat (limited to 'source3')
-rw-r--r--source3/torture/torture.c61
1 files changed, 34 insertions, 27 deletions
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;
}