diff options
author | Jeremy Allison <jra@samba.org> | 2001-12-10 19:48:43 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-12-10 19:48:43 +0000 |
commit | a427fafc1f95d472189e867781a4b75ab0c8adcb (patch) | |
tree | cc95a7080e2913166afaadf4d93b73565b13b7f2 | |
parent | 775c3876dbd02a2beae0626b2e735583ccedffbb (diff) | |
download | samba-a427fafc1f95d472189e867781a4b75ab0c8adcb.tar.gz samba-a427fafc1f95d472189e867781a4b75ab0c8adcb.tar.bz2 samba-a427fafc1f95d472189e867781a4b75ab0c8adcb.zip |
Treat RAP codes differently.
Jeremy.
(This used to be commit 919b11a787145139e6255674179b2ff7e587475d)
-rw-r--r-- | source3/libsmb/clierror.c | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/source3/libsmb/clierror.c b/source3/libsmb/clierror.c index cd1f86a476..81e8be36a8 100644 --- a/source3/libsmb/clierror.c +++ b/source3/libsmb/clierror.c @@ -69,34 +69,35 @@ char *cli_errstr(struct cli_state *cli) { static fstring cli_error_message; uint32 flgs2 = SVAL(cli->inbuf,smb_flg2), errnum; - uint8 errclass; - int i; + uint8 errclass; + int i; - /* Case #1: RAP error */ - for (i = 0; rap_errmap[i].message != NULL; i++) { - if (rap_errmap[i].err == cli->rap_error) { - return rap_errmap[i].message; + /* Case #1: RAP error */ + if (cli->rap_error) { + for (i = 0; rap_errmap[i].message != NULL; i++) { + if (rap_errmap[i].err == cli->rap_error) { + return rap_errmap[i].message; + } } - } - /* Case #2: 32-bit NT errors */ - if (flgs2 & FLAGS2_32_BIT_ERROR_CODES) { - NTSTATUS status = NT_STATUS(IVAL(cli->inbuf,smb_rcls)); + slprintf(cli_error_message, sizeof(cli_error_message) - 1, "RAP code %d", + cli->rap_error); - return get_nt_error_msg(status); - } + return cli_error_message; + } - cli_dos_error(cli, &errclass, &errnum); + /* Case #2: 32-bit NT errors */ + if (flgs2 & FLAGS2_32_BIT_ERROR_CODES) { + NTSTATUS status = NT_STATUS(IVAL(cli->inbuf,smb_rcls)); - /* Case #3: SMB error */ + return get_nt_error_msg(status); + } - if (errclass != 0) - return cli_smb_errstr(cli); + cli_dos_error(cli, &errclass, &errnum); - slprintf(cli_error_message, sizeof(cli_error_message) - 1, "code %d", - cli->rap_error); + /* Case #3: SMB error */ - return cli_error_message; + return cli_smb_errstr(cli); } |