diff options
author | Stefan Metzmacher <metze@samba.org> | 2011-07-08 13:34:38 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-07-08 14:09:09 +0200 |
commit | 0342b69f36acdb9418f4b85ed48f3c6b78ef553f (patch) | |
tree | 973928ef9c349857db101e68f438a92f1ee2e4c6 | |
parent | 2c160224c2bcf241653e313445e21746e772b424 (diff) | |
download | samba-0342b69f36acdb9418f4b85ed48f3c6b78ef553f.tar.gz samba-0342b69f36acdb9418f4b85ed48f3c6b78ef553f.tar.bz2 samba-0342b69f36acdb9418f4b85ed48f3c6b78ef553f.zip |
s3:torture: use cli_is_nt/dos_error() in run_error_map_extract()
Callers should avoid using cli->inbuf directly!
metze
-rw-r--r-- | source3/torture/torture.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/source3/torture/torture.c b/source3/torture/torture.c index a6387c1484..52ae4bb440 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -6142,7 +6142,7 @@ static bool run_error_map_extract(int dummy) { uint32 error; - uint32 flgs2, errnum; + uint32 errnum; uint8 errclass; NTSTATUS nt_status; @@ -6207,29 +6207,27 @@ static bool run_error_map_extract(int dummy) { 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)); + if (cli_is_nt_error(c_nt)) { + nt_status = cli_nt_error(c_nt); } else { printf("/** Dos error on NT connection! (%s) */\n", cli_errstr(c_nt)); nt_status = NT_STATUS(0xc0000000); } - if (NT_STATUS_IS_OK(cli_session_setup(c_dos, user, - password, strlen(password), - password, strlen(password), - workgroup))) { + status = cli_session_setup(c_dos, user, + password, strlen(password), + password, strlen(password), + workgroup); + if (NT_STATUS_IS_OK(status)) { printf("/** Session setup succeeded. This shouldn't happen...*/\n"); } - flgs2 = SVAL(c_dos->inbuf,smb_flg2), errnum; /* Case #1: 32-bit NT errors */ - if (flgs2 & FLAGS2_32_BIT_ERROR_CODES) { + if (!cli_is_dos_error(c_dos)) { printf("/** NT error on DOS connection! (%s) */\n", - cli_errstr(c_nt)); + cli_errstr(c_dos)); errnum = errclass = 0; } else { cli_dos_error(c_dos, &errclass, &errnum); |