Return either STATUS_BUFFER_OVERFLOW or ERRDOS/ERRmoredata depending on
authorMatthew Chapman <matty@samba.org>
Wed, 24 Feb 1999 19:08:43 +0000 (19:08 +0000)
committerMatthew Chapman <matty@samba.org>
Wed, 24 Feb 1999 19:08:43 +0000 (19:08 +0000)
whether the client supports 32-bit error codes.

source/smbd/ipc.c

index c8c3b521944d66e06b0c02fe2a44fe48ca0a63f9..a4d452b2a84cc4c61b36736ea61bb382deddc381 100644 (file)
@@ -61,6 +61,7 @@ extern fstring global_myworkgroup;
 
 extern int Client;
 extern int smb_read_error;
+extern uint32 global_client_caps;
 
 static BOOL api_Unsupported(connection_struct *conn,uint16 vuid, char *param,char *data,
                            int mdrcnt,int mprcnt,
@@ -187,13 +188,15 @@ static void send_trans_reply(char *outbuf,
 
        if (buffer_too_large)
        {
-#if 0
-               /* issue a buffer size warning.  on a DCE/RPC pipe, expect an SMBreadX... */
-               SIVAL(outbuf, smb_flg2, FLAGS2_32_BIT_ERROR_CODES);
-               SIVAL(outbuf, smb_rcls, 0x80000000 | NT_STATUS_ACCESS_VIOLATION);
-#endif
-               SCVAL(outbuf, smb_rcls, ERRDOS);
-               SSVAL(outbuf, smb_err, ERRmoredata);
+               if (global_client_caps & CAP_STATUS32)
+               {
+                       /* issue a buffer size warning.  on a DCE/RPC pipe, expect an SMBreadX... */
+                       SIVAL(outbuf, smb_flg2, FLAGS2_32_BIT_ERROR_CODES);
+                       SIVAL(outbuf, smb_rcls, 0x80000005); /* STATUS_BUFFER_OVERFLOW */
+               } else {
+                       SCVAL(outbuf, smb_rcls, ERRDOS);
+                       SSVAL(outbuf, smb_err, ERRmoredata);
+               }
        }
 
        copy_trans_params_and_data(outbuf, align,