summaryrefslogtreecommitdiff
path: root/source4/smb_server/request.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/smb_server/request.c')
-rw-r--r--source4/smb_server/request.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source4/smb_server/request.c b/source4/smb_server/request.c
index 065e63a8d2..964f4a2d70 100644
--- a/source4/smb_server/request.c
+++ b/source4/smb_server/request.c
@@ -310,8 +310,15 @@ void req_reply_error(struct request_context *req, NTSTATUS status)
return;
}
- SIVAL(req->out.hdr, HDR_RCLS, NT_STATUS_V(status));
- SSVAL(req->out.hdr, HDR_FLG2, SVAL(req->out.hdr, HDR_FLG2) | FLAGS2_32_BIT_ERROR_CODES);
+ if (NT_STATUS_IS_DOS(status)) {
+ /* its a encoded DOS error, using the reserved range */
+ SSVAL(req->out.hdr, HDR_RCLS, NT_STATUS_DOS_CLASS(status));
+ SSVAL(req->out.hdr, HDR_ERR, NT_STATUS_DOS_CODE(status));
+ SSVAL(req->out.hdr, HDR_FLG2, SVAL(req->out.hdr, HDR_FLG2) & ~FLAGS2_32_BIT_ERROR_CODES);
+ } else {
+ SIVAL(req->out.hdr, HDR_RCLS, NT_STATUS_V(status));
+ SSVAL(req->out.hdr, HDR_FLG2, SVAL(req->out.hdr, HDR_FLG2) | FLAGS2_32_BIT_ERROR_CODES);
+ }
req_send_reply(req);
}