[GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch.
[samba.git] / source / smbd / srvstr.c
index 1daa25553f8382fc36aa2d22ec753daba2b0d9c9..68e61033ae1a30b482073a53ca62fb534a52afef 100644 (file)
@@ -24,7 +24,7 @@ extern int max_send;
 /* Make sure we can't write a string past the end of the buffer */
 
 size_t srvstr_push_fn(const char *function, unsigned int line, 
-                     const char *base_ptr, void *dest, 
+                     const char *base_ptr, uint16 smb_flags2, void *dest,
                      const char *src, int dest_len, int flags)
 {
        size_t buf_used = PTR_DIFF(dest, base_ptr);
@@ -33,13 +33,17 @@ size_t srvstr_push_fn(const char *function, unsigned int line,
 #if 0
                        DEBUG(0, ("Pushing string of 'unlimited' length into non-SMB buffer!\n"));
 #endif
-                       return push_string_fn(function, line, base_ptr, dest, src, -1, flags);
+                       return push_string_fn(function, line, base_ptr,
+                                             smb_flags2, dest, src, -1,
+                                             flags);
                }
-               return push_string_fn(function, line, base_ptr, dest, src, max_send - buf_used, flags);
+               return push_string_fn(function, line, base_ptr, smb_flags2,
+                                     dest, src, max_send - buf_used, flags);
        }
        
        /* 'normal' push into size-specified buffer */
-       return push_string_fn(function, line, base_ptr, dest, src, dest_len, flags);
+       return push_string_fn(function, line, base_ptr, smb_flags2, dest, src,
+                             dest_len, flags);
 }
 
 /*******************************************************************
@@ -68,14 +72,14 @@ ssize_t message_push_string(uint8 **outbuf, const char *str, int flags)
                return -1;
        }
 
-       result = srvstr_push((char *)tmp, tmp + buf_size, str, grow_size,
-                            flags);
+       result = srvstr_push((char *)tmp, SVAL(tmp, smb_flg2),
+                            tmp + buf_size, str, grow_size, flags);
 
        if (result == (size_t)-1) {
                DEBUG(0, ("srvstr_push failed\n"));
                return -1;
        }
-       set_message_bcc(NULL, (char *)tmp, smb_buflen(tmp) + result);
+       set_message_bcc((char *)tmp, smb_buflen(tmp) + result);
 
        *outbuf = tmp;