diff options
Diffstat (limited to 'source4/libcli/raw')
-rw-r--r-- | source4/libcli/raw/clitransport.c | 21 | ||||
-rw-r--r-- | source4/libcli/raw/libcliraw.h | 6 | ||||
-rw-r--r-- | source4/libcli/raw/rawnegotiate.c | 6 |
3 files changed, 20 insertions, 13 deletions
diff --git a/source4/libcli/raw/clitransport.c b/source4/libcli/raw/clitransport.c index 999795b81e..51a718b10b 100644 --- a/source4/libcli/raw/clitransport.c +++ b/source4/libcli/raw/clitransport.c @@ -476,15 +476,22 @@ static void smbcli_transport_finish_recv(struct smbcli_transport *transport) req->flags2 = SVAL(req->in.hdr, HDR_FLG2); if (!(req->flags2 & FLAGS2_32_BIT_ERROR_CODES)) { - transport->error.etype = ETYPE_DOS; - transport->error.e.dos.eclass = CVAL(req->in.hdr,HDR_RCLS); - transport->error.e.dos.ecode = SVAL(req->in.hdr,HDR_ERR); - req->status = dos_to_ntstatus(transport->error.e.dos.eclass, - transport->error.e.dos.ecode); + int class = CVAL(req->in.hdr,HDR_RCLS); + int code = SVAL(req->in.hdr,HDR_ERR); + if (class == 0 && code == 0) { + transport->error.e.nt_status = NT_STATUS_OK; + } else { + transport->error.e.nt_status = NT_STATUS_DOS(class, code); + } } else { - transport->error.etype = ETYPE_NT; transport->error.e.nt_status = NT_STATUS(IVAL(req->in.hdr, HDR_RCLS)); - req->status = transport->error.e.nt_status; + } + + req->status = transport->error.e.nt_status; + if (NT_STATUS_IS_OK(req->status)) { + transport->error.etype = ETYPE_NONE; + } else { + transport->error.etype = ETYPE_SMB; } if (!smbcli_request_check_sign_mac(req)) { diff --git a/source4/libcli/raw/libcliraw.h b/source4/libcli/raw/libcliraw.h index 2794a22da2..bb13210e74 100644 --- a/source4/libcli/raw/libcliraw.h +++ b/source4/libcli/raw/libcliraw.h @@ -124,12 +124,8 @@ struct smbcli_transport { /* the error fields from the last message */ struct { - enum {ETYPE_NONE, ETYPE_DOS, ETYPE_NT, ETYPE_SOCKET, ETYPE_NBT} etype; + enum {ETYPE_NONE, ETYPE_SMB, ETYPE_SOCKET, ETYPE_NBT} etype; union { - struct { - uint8_t eclass; - uint16_t ecode; - } dos; NTSTATUS nt_status; enum {SOCKET_READ_TIMEOUT, SOCKET_READ_EOF, diff --git a/source4/libcli/raw/rawnegotiate.c b/source4/libcli/raw/rawnegotiate.c index d2d6b66d59..07b9dd572a 100644 --- a/source4/libcli/raw/rawnegotiate.c +++ b/source4/libcli/raw/rawnegotiate.c @@ -174,10 +174,14 @@ NTSTATUS smb_raw_negotiate_recv(struct smbcli_request *req) } /* a way to force ascii SMB */ - if (!lp_unicode() || getenv("SMBCLI_FORCE_ASCII")) { + if (!lp_unicode()) { transport->negotiate.capabilities &= ~CAP_UNICODE; } + if (!lp_nt_status_support()) { + transport->negotiate.capabilities &= ~CAP_STATUS32; + } + failed: return smbcli_request_destroy(req); } |