Fix from Charles Hoch (hoch@hpl.hp.com). Whne there is no data
authorJeremy Allison <jra@samba.org>
Wed, 28 Jan 1998 13:11:58 +0000 (13:11 +0000)
committerJeremy Allison <jra@samba.org>
Wed, 28 Jan 1998 13:11:58 +0000 (13:11 +0000)
to send, setting the data alignment to a 4 byte boundary causes
a few extra bytes to be sent. This seems to cause the NT redirector
to *sometimes* fail.
Jeremy.
(This used to be commit f6ee3263dac960772024bf9009ad0ddce6d8f289)

source3/smbd/trans2.c

index 139ded57b24b5ccebb623ee217dea3107bec0ef0..a9e15f65c493be3bdbdd87c0f5de3b0b0635af36 100644 (file)
@@ -70,8 +70,10 @@ static int send_trans2_replies(char *outbuf, int bufsize, char *params,
       return 0;
     }
 
-  /* when sending params and data ensure that both are nicely aligned */
-  if ((params_to_send % 4) != 0)
+  /* When sending params and data ensure that both are nicely aligned */
+  /* Only do this alignment when there is also data to send - else
+     can cause NT redirector problems. */
+  if (((params_to_send % 4) != 0) && (data_to_send != 0))
          data_alignment_offset = 4 - (params_to_send % 4);
 
   /* Space is bufsize minus Netbios over TCP header minus SMB header */