diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-06-24 16:26:23 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-06-24 16:26:23 +1000 |
commit | 6da26870e0ae5acd6ff49a30ec2f6886b44d095e (patch) | |
tree | 850c71039563c16a5d563c47e7ba2ab645baf198 /source3/libsmb/clierror.c | |
parent | 6925a799d04c6fa59dd2ddef1f5510f9bb7d17d1 (diff) | |
parent | 2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 (diff) | |
download | samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.tar.gz samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.tar.bz2 samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.zip |
Merge 2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 as Samba-4.0alpha16
Diffstat (limited to 'source3/libsmb/clierror.c')
-rw-r--r-- | source3/libsmb/clierror.c | 39 |
1 files changed, 1 insertions, 38 deletions
diff --git a/source3/libsmb/clierror.c b/source3/libsmb/clierror.c index 015afb18aa..d5ac8937ed 100644 --- a/source3/libsmb/clierror.c +++ b/source3/libsmb/clierror.c @@ -20,6 +20,7 @@ */ #include "includes.h" +#include "libsmb/libsmb.h" /***************************************************** RAP error codes - a small start but will be extended. @@ -322,44 +323,6 @@ bool cli_is_dos_error(struct cli_state *cli) return cli_is_error(cli) && !(flgs2 & FLAGS2_32_BIT_ERROR_CODES); } -/* Return the last error always as an NTSTATUS. */ - -NTSTATUS cli_get_nt_error(struct cli_state *cli) -{ - if (cli_is_nt_error(cli)) { - return cli_nt_error(cli); - } else if (cli_is_dos_error(cli)) { - uint32 ecode; - uint8 eclass; - cli_dos_error(cli, &eclass, &ecode); - return dos_to_ntstatus(eclass, ecode); - } else { - /* Something went wrong, we don't know what. */ - return NT_STATUS_UNSUCCESSFUL; - } -} - -/* Push an error code into the inbuf to be returned on the next - * query. */ - -void cli_set_nt_error(struct cli_state *cli, NTSTATUS status) -{ - SSVAL(cli->inbuf,smb_flg2, SVAL(cli->inbuf,smb_flg2)|FLAGS2_32_BIT_ERROR_CODES); - SIVAL(cli->inbuf, smb_rcls, NT_STATUS_V(status)); -} - -/* Reset an error. */ - -void cli_reset_error(struct cli_state *cli) -{ - if (SVAL(cli->inbuf,smb_flg2) & FLAGS2_32_BIT_ERROR_CODES) { - SIVAL(cli->inbuf, smb_rcls, NT_STATUS_V(NT_STATUS_OK)); - } else { - SCVAL(cli->inbuf,smb_rcls,0); - SSVAL(cli->inbuf,smb_err,0); - } -} - bool cli_state_is_connected(struct cli_state *cli) { if (cli == NULL) { |