s3-libsmb: introduce option to disable dos error mapping
authorBjörn Baumbach <bb@sernet.de>
Wed, 16 Nov 2011 13:45:01 +0000 (14:45 +0100)
committerStefan Metzmacher <metze@samba.org>
Wed, 16 Nov 2011 18:02:12 +0000 (19:02 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
source3/include/client.h
source3/libsmb/async_smb.c
source3/libsmb/clientgen.c

index 65da738e2282a55ce1d8f44a88ee4ef4cdd9c166..293138d57473b7ac3d6fd2cd80b4770a4a100e42 100644 (file)
@@ -44,6 +44,7 @@ struct cli_state {
         struct cli_state *prev, *next;
        int rap_error;
        NTSTATUS raw_status; /* maybe via NT_STATUS_DOS() */
+       bool map_dos_errors;
 
        /* The credentials used to open the cli_state connection. */
        char *domain;
index 08b6c3561ec8e828ad6a6360dd6e083851c685a3..574ca3b2ba675a724978ecf0f93e50ced9e11f60 100644 (file)
@@ -897,7 +897,8 @@ NTSTATUS cli_smb_recv(struct tevent_req *req,
        }
 
        state->cli->raw_status = cli_pull_raw_error(state->inbuf);
-       if (NT_STATUS_IS_DOS(state->cli->raw_status)) {
+       if (NT_STATUS_IS_DOS(state->cli->raw_status) &&
+           state->cli->map_dos_errors) {
                uint8_t eclass = NT_STATUS_DOS_CLASS(state->cli->raw_status);
                uint16_t ecode = NT_STATUS_DOS_CODE(state->cli->raw_status);
                /*
index bc544afd32476dd839e643867d68b22920957dbd..215ad3fec4ebd2c6dbacaa204c0deb96ce043a7f 100644 (file)
@@ -208,6 +208,7 @@ struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx,
                goto error;
        }
        cli->raw_status = NT_STATUS_INTERNAL_ERROR;
+       cli->map_dos_errors = true; /* remove this */
        cli->timeout = 20000; /* Timeout is in milliseconds. */
        cli->case_sensitive = false;