mirror of
https://github.com/samba-team/samba.git
synced 2025-01-12 09:18:10 +03:00
r13877: remove smbsrv_send_dos_error() and use smbsrv_send_error(..,NT_STATUS_DOS())
metze
(This used to be commit 60d7920527
)
This commit is contained in:
parent
8d91f3dec0
commit
edd5b847bc
@ -379,7 +379,7 @@ void smbsrv_reply_nttrans(struct smbsrv_request *req)
|
|||||||
trans.in.function = SVAL(req->in.vwv, 36);
|
trans.in.function = SVAL(req->in.vwv, 36);
|
||||||
|
|
||||||
if (req->in.wct != 19 + trans.in.setup_count) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -568,7 +568,7 @@ void smbsrv_chain_reply(struct smbsrv_request *req)
|
|||||||
uint16_t data_size;
|
uint16_t data_size;
|
||||||
|
|
||||||
if (req->in.wct < 2 || req->out.wct < 2) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -623,7 +623,7 @@ void smbsrv_chain_reply(struct smbsrv_request *req)
|
|||||||
error:
|
error:
|
||||||
SSVAL(req->out.vwv, VWV(0), SMB_CHAIN_NONE);
|
SSVAL(req->out.vwv, VWV(0), SMB_CHAIN_NONE);
|
||||||
SSVAL(req->out.vwv, VWV(1), 0);
|
SSVAL(req->out.vwv, VWV(1), 0);
|
||||||
smbsrv_send_dos_error(req, ERRSRV, ERRerror);
|
smbsrv_send_error(req, NT_STATUS_DOS(ERRSRV, ERRerror));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
if ((req)->in.wct != (wcount)) { \
|
if ((req)->in.wct != (wcount)) { \
|
||||||
DEBUG(1,("Unexpected WCT %d at %s(%d) - expected %d\n", \
|
DEBUG(1,("Unexpected WCT %d at %s(%d) - expected %d\n", \
|
||||||
(req)->in.wct, __FILE__, __LINE__, wcount)); \
|
(req)->in.wct, __FILE__, __LINE__, wcount)); \
|
||||||
smbsrv_send_dos_error(req, ERRSRV, ERRerror); \
|
smbsrv_send_error(req, NT_STATUS_DOS(ERRSRV, ERRerror)); \
|
||||||
return; \
|
return; \
|
||||||
}} while (0)
|
}} 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));
|
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)
|
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)
|
void smbsrv_reply_readbmpx(struct smbsrv_request *req)
|
||||||
{
|
{
|
||||||
/* tell the client to not use a multiplexed read - its too broken to use */
|
/* 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)
|
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)
|
void smbsrv_reply_writebs(struct smbsrv_request *req)
|
||||||
{
|
{
|
||||||
smbsrv_send_dos_error(req, ERRSRV, ERRuseSTD);
|
smbsrv_send_error(req, NT_STATUS_DOS(ERRSRV, ERRuseSTD));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -312,25 +312,6 @@ void smbsrv_send_reply(struct smbsrv_request *req)
|
|||||||
smbsrv_send_reply_nosign(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
|
setup the header of a reply to include an NTSTATUS code
|
||||||
*/
|
*/
|
||||||
|
@ -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));
|
trans->in.setup_count = CVAL(req->in.vwv, VWV(13));
|
||||||
|
|
||||||
if (req->in.wct != 14 + trans->in.setup_count) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user