summaryrefslogtreecommitdiff
path: root/source3/smbd/ipc.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-08-27 08:19:43 +0000
committerAndrew Tridgell <tridge@samba.org>2001-08-27 08:19:43 +0000
commite8e98c9ea0690e3acf1126b50882e59e1056c7b3 (patch)
tree2fa75bc825f7e5da041809fe49080e3319656506 /source3/smbd/ipc.c
parent3820578473da81b7ae0dfa978605da809be59f62 (diff)
downloadsamba-e8e98c9ea0690e3acf1126b50882e59e1056c7b3.tar.gz
samba-e8e98c9ea0690e3acf1126b50882e59e1056c7b3.tar.bz2
samba-e8e98c9ea0690e3acf1126b50882e59e1056c7b3.zip
converted smbd to use NTSTATUS by default
major changes include: - added NSTATUS type - added automatic mapping between dos and nt error codes - changed all ERROR() calls to ERROR_DOS() and many to ERROR_NT() these calls auto-translate to the client error code system - got rid of the cached error code and the writebmpx code We eventually will need to also: - get rid of BOOL, so we don't lose error info - replace all ERROR_DOS() calls with ERROR_NT() calls but that is too much for one night (This used to be commit 83d9896c1ea8be796192b51a4678c2a3b87f7518)
Diffstat (limited to 'source3/smbd/ipc.c')
-rw-r--r--source3/smbd/ipc.c28
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);