diff options
author | Stefan Metzmacher <metze@samba.org> | 2006-03-06 18:29:48 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:52:19 -0500 |
commit | edd5b847bcd5a75770ea9de7ac1c419de8bc76ba (patch) | |
tree | 8967ebada7819dd611af1510bb4a83d7c589c616 /source4/smb_server/smb | |
parent | 8d91f3dec02fd024903ac7ef748d704ef6f25228 (diff) | |
download | samba-edd5b847bcd5a75770ea9de7ac1c419de8bc76ba.tar.gz samba-edd5b847bcd5a75770ea9de7ac1c419de8bc76ba.tar.bz2 samba-edd5b847bcd5a75770ea9de7ac1c419de8bc76ba.zip |
r13877: remove smbsrv_send_dos_error() and use smbsrv_send_error(..,NT_STATUS_DOS())
metze
(This used to be commit 60d7920527cd0e4142427fa59b9e617d99e3d984)
Diffstat (limited to 'source4/smb_server/smb')
-rw-r--r-- | source4/smb_server/smb/nttrans.c | 2 | ||||
-rw-r--r-- | source4/smb_server/smb/receive.c | 4 | ||||
-rw-r--r-- | source4/smb_server/smb/reply.c | 12 | ||||
-rw-r--r-- | source4/smb_server/smb/request.c | 19 | ||||
-rw-r--r-- | source4/smb_server/smb/trans2.c | 2 |
5 files changed, 10 insertions, 29 deletions
diff --git a/source4/smb_server/smb/nttrans.c b/source4/smb_server/smb/nttrans.c index 8872398fc6..cb36f43b8a 100644 --- a/source4/smb_server/smb/nttrans.c +++ b/source4/smb_server/smb/nttrans.c @@ -379,7 +379,7 @@ void smbsrv_reply_nttrans(struct smbsrv_request *req) trans.in.function = SVAL(req->in.vwv, 36); if (req->in.wct != 19 + trans.in.setup_count) { - smbsrv_send_dos_error(req, ERRSRV, ERRerror); + smbsrv_send_error(req, NT_STATUS_DOS(ERRSRV, ERRerror)); return; } diff --git a/source4/smb_server/smb/receive.c b/source4/smb_server/smb/receive.c index b7972e6b44..8430871c19 100644 --- a/source4/smb_server/smb/receive.c +++ b/source4/smb_server/smb/receive.c @@ -568,7 +568,7 @@ void smbsrv_chain_reply(struct smbsrv_request *req) uint16_t data_size; if (req->in.wct < 2 || req->out.wct < 2) { - smbsrv_send_dos_error(req, ERRSRV, ERRerror); + smbsrv_send_error(req, NT_STATUS_DOS(ERRSRV, ERRerror)); return; } @@ -623,7 +623,7 @@ void smbsrv_chain_reply(struct smbsrv_request *req) error: SSVAL(req->out.vwv, VWV(0), SMB_CHAIN_NONE); SSVAL(req->out.vwv, VWV(1), 0); - smbsrv_send_dos_error(req, ERRSRV, ERRerror); + smbsrv_send_error(req, NT_STATUS_DOS(ERRSRV, ERRerror)); } /* diff --git a/source4/smb_server/smb/reply.c b/source4/smb_server/smb/reply.c index 0da61ef253..9aad3ef015 100644 --- a/source4/smb_server/smb/reply.c +++ b/source4/smb_server/smb/reply.c @@ -33,7 +33,7 @@ if ((req)->in.wct != (wcount)) { \ DEBUG(1,("Unexpected WCT %d at %s(%d) - expected %d\n", \ (req)->in.wct, __FILE__, __LINE__, wcount)); \ - smbsrv_send_dos_error(req, ERRSRV, ERRerror); \ + smbsrv_send_error(req, NT_STATUS_DOS(ERRSRV, ERRerror)); \ return; \ }} while (0) @@ -200,7 +200,7 @@ void smbsrv_reply_unknown(struct smbsrv_request *req) DEBUG(0,("unknown command type %d (0x%X)\n", type, type)); - smbsrv_send_dos_error(req, ERRSRV, ERRunknownsmb); + smbsrv_send_error(req, NT_STATUS_DOS(ERRSRV, ERRunknownsmb)); } @@ -941,7 +941,7 @@ void smbsrv_reply_read_and_X(struct smbsrv_request *req) ****************************************************************************/ void smbsrv_reply_writebraw(struct smbsrv_request *req) { - smbsrv_send_dos_error(req, ERRSRV, ERRuseSTD); + smbsrv_send_error(req, NT_STATUS_DOS(ERRSRV, ERRuseSTD)); } @@ -1854,7 +1854,7 @@ void smbsrv_reply_lockingX(struct smbsrv_request *req) void smbsrv_reply_readbmpx(struct smbsrv_request *req) { /* tell the client to not use a multiplexed read - its too broken to use */ - smbsrv_send_dos_error(req, ERRSRV, ERRuseSTD); + smbsrv_send_error(req, NT_STATUS_DOS(ERRSRV, ERRuseSTD)); } @@ -1890,7 +1890,7 @@ void smbsrv_reply_setattrE(struct smbsrv_request *req) ****************************************************************************/ void smbsrv_reply_writebmpx(struct smbsrv_request *req) { - smbsrv_send_dos_error(req, ERRSRV, ERRuseSTD); + smbsrv_send_error(req, NT_STATUS_DOS(ERRSRV, ERRuseSTD)); } @@ -1899,7 +1899,7 @@ void smbsrv_reply_writebmpx(struct smbsrv_request *req) ****************************************************************************/ void smbsrv_reply_writebs(struct smbsrv_request *req) { - smbsrv_send_dos_error(req, ERRSRV, ERRuseSTD); + smbsrv_send_error(req, NT_STATUS_DOS(ERRSRV, ERRuseSTD)); } diff --git a/source4/smb_server/smb/request.c b/source4/smb_server/smb/request.c index 4b501ad973..cc72b412e7 100644 --- a/source4/smb_server/smb/request.c +++ b/source4/smb_server/smb/request.c @@ -312,25 +312,6 @@ void smbsrv_send_reply(struct smbsrv_request *req) smbsrv_send_reply_nosign(req); } - - -/* - construct and send an error packet with a forced DOS error code - this is needed to match win2000 behaviour for some parts of the protocol -*/ -void smbsrv_send_dos_error(struct smbsrv_request *req, uint8_t eclass, uint16_t ecode) -{ - /* if the basic packet hasn't been setup yet then do it now */ - if (req->out.buffer == NULL) { - smbsrv_setup_reply(req, 0, 0); - } - - SCVAL(req->out.hdr, HDR_RCLS, eclass); - SSVAL(req->out.hdr, HDR_ERR, ecode); - SSVAL(req->out.hdr, HDR_FLG2, SVAL(req->out.hdr, HDR_FLG2) & ~FLAGS2_32_BIT_ERROR_CODES); - smbsrv_send_reply(req); -} - /* setup the header of a reply to include an NTSTATUS code */ diff --git a/source4/smb_server/smb/trans2.c b/source4/smb_server/smb/trans2.c index da2a5999a4..be14961082 100644 --- a/source4/smb_server/smb/trans2.c +++ b/source4/smb_server/smb/trans2.c @@ -1610,7 +1610,7 @@ static void reply_trans_generic(struct smbsrv_request *req, uint8_t command) trans->in.setup_count = CVAL(req->in.vwv, VWV(13)); if (req->in.wct != 14 + trans->in.setup_count) { - smbsrv_send_dos_error(req, ERRSRV, ERRerror); + smbsrv_send_error(req, NT_STATUS_DOS(ERRSRV, ERRerror)); return; } |