diff options
Diffstat (limited to 'source3/smbd/ipc.c')
-rw-r--r-- | source3/smbd/ipc.c | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/source3/smbd/ipc.c b/source3/smbd/ipc.c index e853112bfe..a323261d88 100644 --- a/source3/smbd/ipc.c +++ b/source3/smbd/ipc.c @@ -36,7 +36,6 @@ extern fstring local_machine; #define NERR_notsupported 50 extern int smb_read_error; -extern uint32 global_client_caps; /******************************************************************* copies parameters and data, as needed, into the smb buffer @@ -98,21 +97,12 @@ void send_trans_reply(char *outbuf, align = ((this_lparam)%4); - set_message(outbuf,10,1+align+this_ldata+this_lparam,True); - - if (buffer_too_large) - { - /* issue a buffer size warning. on a DCE/RPC pipe, expect an SMBreadX... */ - if (!(global_client_caps & (CAP_NT_SMBS | CAP_STATUS32 ))) { - /* Win9x version. */ - SSVAL(outbuf, smb_err, ERRmoredata); - SCVAL(outbuf, smb_rcls, ERRDOS); - } else { - SIVAL(outbuf, smb_flg2, SVAL(outbuf, smb_flg2) | FLAGS2_32_BIT_ERROR_CODES); - SIVAL(outbuf, smb_rcls, 0x80000000 | STATUS_BUFFER_OVERFLOW); - } + if (buffer_too_large) { + ERROR_NT(STATUS_BUFFER_OVERFLOW); } + set_message(outbuf,10,1+align+this_ldata+this_lparam,True); + copy_trans_params_and_data(outbuf, align, rparam, tot_param_sent, this_lparam, rdata, tot_data_sent, this_ldata); @@ -395,7 +385,7 @@ int reply_trans(connection_struct *conn, char *inbuf,char *outbuf, int size, int if((data = (char *)malloc(tdscnt)) == NULL) { DEBUG(0,("reply_trans: data malloc fail for %d bytes !\n", tdscnt)); END_PROFILE(SMBtrans); - return(ERROR(ERRDOS,ERRnomem)); + return(ERROR_DOS(ERRDOS,ERRnomem)); } memcpy(data,smb_base(inbuf)+dsoff,dscnt); } @@ -404,7 +394,7 @@ int reply_trans(connection_struct *conn, char *inbuf,char *outbuf, int size, int if((params = (char *)malloc(tpscnt)) == NULL) { DEBUG(0,("reply_trans: param malloc fail for %d bytes !\n", tpscnt)); END_PROFILE(SMBtrans); - return(ERROR(ERRDOS,ERRnomem)); + return(ERROR_DOS(ERRDOS,ERRnomem)); } memcpy(params,smb_base(inbuf)+psoff,pscnt); } @@ -414,7 +404,7 @@ int reply_trans(connection_struct *conn, char *inbuf,char *outbuf, int size, int if((setup = (uint16 *)malloc(suwcnt*sizeof(uint16))) == NULL) { DEBUG(0,("reply_trans: setup malloc fail for %d bytes !\n", (int)(suwcnt * sizeof(uint16)))); END_PROFILE(SMBtrans); - return(ERROR(ERRDOS,ERRnomem)); + return(ERROR_DOS(ERRDOS,ERRnomem)); } for (i=0;i<suwcnt;i++) setup[i] = SVAL(inbuf,smb_vwv14+i*SIZEOFWORD); @@ -451,7 +441,7 @@ int reply_trans(connection_struct *conn, char *inbuf,char *outbuf, int size, int if (setup) free(setup); END_PROFILE(SMBtrans); - return(ERROR(ERRSRV,ERRerror)); + return(ERROR_DOS(ERRSRV,ERRerror)); } show_msg(inbuf); @@ -528,7 +518,7 @@ int reply_trans(connection_struct *conn, char *inbuf,char *outbuf, int size, int if (outsize == 0) { END_PROFILE(SMBtrans); - return(ERROR(ERRSRV,ERRnosupport)); + return(ERROR_DOS(ERRSRV,ERRnosupport)); } END_PROFILE(SMBtrans); |